Facebook | Phone | Missing Ranges & Making a Large Island
Anonymous User
2109

Position: E5
Location: New York

First EASY, a variation of https://leetcode.com/problems/missing-ranges/

Second, HARD, exactly this one : https://leetcode.com/problems/making-a-large-island/

"Given a Matrix NxM, find the largest island if you convert one water cell to land"
0 = Water
1 = Land
Example:

[[1, 0, 1],
 [0, 1, 0],
 [1, 1, 1]] 
 
 Answer is 7

I answered both, first one in less than 5 min, the second one took me a good 30 minutes, where I used a Union Find approach. (FYI, my solution has 114 lines... that's insane)

Update: add the LC link for the second question

Comments (3)