Number of Islands
Recognize the pattern
Brute force idea
The naive version of Number of Islands sounds like this: No simpler alternative — graph traversal is the natural approach. That direct path helps you understand the question, but it tends to treat every possibility as brand new instead of learning from earlier steps.
Better approach
A calmer way to see Number of Islands is this: DFS/BFS from each unvisited '1', mark all connected land. The goal is not to be clever for its own sake, but to remember the one relationship that keeps the solution grounded as you move forward.
Key invariant
The truth you want to protect throughout Number of Islands is this: Each DFS/BFS call discovers one complete island and marks it as visited. If that remains true after every update, the rest of the reasoning has a stable place to stand.
Watch out for
One easy way to drift off course in Number of Islands is this: Not marking cells as visited — causes infinite loops or double counting. The fix is usually to return to the meaning of each move, not just the steps themselves.