As reported: Oracle OCI (USA) Senior Software Engineer onsite, a coding round, Jan 2025 — after behavioral questions. The onsite's other coding round asked to merge two arrays in zigzag order.
Example:
Input: grid = [
["1","1","1","1","0"],
["1","1","0","1","0"],
["1","1","0","0","0"],
["0","0","0","0","0"]
]
Output: 1
Input: grid = [
["1","1","0","0","0"],
["1","1","0","0","0"],
["0","0","1","0","0"],
["0","0","0","1","1"]
]
Output: 3
This is LeetCode 200 — Number of Islands.
Code runner format: LeetCode's test-case format, one JSON value per line (one line per argument). Implement numIslands(grid); the harness prints the result as JSON.