Company: Arcadis

Difficulty: medium

Problem Statement

Number of Distinct Islands Given an `m x n` binary grid, count distinct island shapes. Cells with value `1` connect horizontally or vertically. Two islands are identical only when one can be translated onto the other; rotation and reflection do not count. Input Format First line: `m n`. Next `m*n` integers are the grid in row-major order. Output Format Print the number of distinct shapes. Constraints `1 <= m,n <= 200`.

More Arcadis OA questionsInterview experiences