Leetcode 1020 — Number of Enclaves [Solution]

Solve Leetcode Problems and Get Offers From Your Dream Companies

Nil Madhab
Javarevisited

--

In this series, I am going to solve Leetcode medium problems live with my friends, which you can see on our youtube channel, Today we will do Problem Leetcode: 1020. Number of Enclaves

A little bit about me, I have offers from Uber India and Amazon India in the past, and I am currently working for Booking.com in Amsterdam.

Motivation to learn algorithms

Problem Statement

Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land)

A move consists of walking from one land square 4-directionally to another land square, or of the boundary of the grid.

--

--

Nil Madhab
Javarevisited

Developer @Booking.com | ex: Samsung, OYO | IIT Kharagpur | Entrepreneur, founder of simplecoding.dev | JOIN Medium, https://nilmadhab.medium.com/membership