Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(matrix) {
- let result = 0;
- for (let row = 0; row < matrix.length; row++) {
- for (let col = 0; col < matrix[row].length; col++) {
- if (matrix[row][col] > result) {
- result = matrix[row][col];
- }
- }
- }
- return result;
- }
- let resultValue = solve([[20, 50, 10],
- [8, 33, 145]]);
- console.log(resultValue);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement