๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
class Solution:
def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
max_area = 0
for r in range(len(grid)):
for c in range(len(grid[r])):
if grid[r][c] == 1:
max_area = max(max_area, self.explore(grid, r, c))
return max_area

def explore(self, grid, r, c):
if (r < 0 or r >= len(grid)) or (c < 0 or c >= len(grid[r])):
return 0
if grid[r][c] == 0:
return 0
# mark as visited
grid[r][c] = 0
return 1 + self.explore(grid, r - 1, c) + self.explore(grid, r, c - 1) + self.explore(grid, r + 1, c) + self.explore(grid, r, c + 1)
What I learned so far...


Just to earn little bit more,
๐๐ž๐ฏ๐ž๐ซ ๐œ๐จ๐ฆ๐ฉ๐ซ๐จ๐ฆ๐ข๐ฌ๐ž ๐ฐ๐ข๐ญ๐ก ๐ฒ๐จ๐ฎ ๐–๐จ๐ซ๐ค ๐ฅ๐ข๐Ÿ๐ž ๐›๐š๐ฅ๐š๐ง๐œ๐ž ๐Ÿคž๐Ÿ’ฏ

#experienced
โค1