A loop inside a loop visits every combination of indices. Break from the inner loop to stop early.
Challenge: Write findInMatrix(matrix, target) that searches a 2D array and returns [row, col] of the first match, or null if not found.
findInMatrix(matrix, target)
[row, col]
null