Microsoft interview question

2D array battleship leetcode question