intermediateDSA & Coding190 of 436
Number of Islands — then implement it in Java, without prior notice
Tests whether you can translate the standard flood-fill (DFS/BFS from each unvisited land cell, marking visited) into working Java under time pressure, including correct grid bounds checking.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response