Count islands and distinct shapes
LinkedInSoftware Engineer · OnsiteLast updated
This question evaluates a candidate's understanding of grid-based graph traversal and connected-component detection, along with the ability to recognize and canonicalize distinct island shapes.
Question
LeetCode 200. Number of Islands LeetCode 694. Number of Distinct Islands
https://leetcode.com/problems/number-of-islands/description/ https://leetcode.com/problems/number-of-distinct-islands/description/
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.