Frontend - Tiktok - Phone Screen

Title Template

[TikTok] - [Frontend Engineer] - [Phone Screen]

Description Template:
Level: [Senior]
Education: [Masters
Years of Experience: [5]
Questions Asked: [Leetcode - Distinctive Island]

// You are given an m x n binary matrix grid. An island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.

// Calculate the number of unique shapes of islands
// Example 1:
const grid1 = [
[0,0,1,0,0,0,0],
[0,0,0,0,0,0,0],
[0,1,1,0,1,0,0],
[0,1,0,0,1,1,0],
[0,1,0,0,1,1,0]]
// //Output: 3

//Example 2:
const grid2 = [
[0,0,1,0,0,0,0],
[0,0,0,0,0,0,0],
[0,1,1,0,1,1,0],
[0,1,0,0,1,0,0],
[0,1,0,0,1,0,0]]
// Output: 2