File tree Expand file tree Collapse file tree
solutions/0695_Max_Area_Of_Island Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,37 +9,37 @@ Automatically synchronize accepted LeetCode submissions to GitHub.
99``` text
1010████████████░░░░░░░░░░░░░░░░░░
1111
12- Solved: 122 / 300 Problems
12+ Solved: 123 / 300 Problems
1313
1414📊 Statistics
1515Difficulty Solved
1616🟢 Easy 63
17- 🟡 Medium 53
17+ 🟡 Medium 54
1818🔴 Hard 6
19- Total 122
19+ Total 123
2020🔥 Latest Accepted Problem
2121
2222
2323| Field | Value |
2424|------|------|
25- | Problem ID | 200 |
26- | Title | Number Of Islands |
25+ | Problem ID | 695 |
26+ | Title | Max Area Of Island |
2727| Language | Python3 |
28- | Runtime | 252 ms |
29- | Memory | 21.6 MB |
28+ | Runtime | 22 ms |
29+ | Memory | 20.7 MB |
3030
3131
3232💻 Languages Used
3333
34- - **Python3** : 6
34+ - **Python3** : 7
3535
3636## 📚 Recent Accepted Problems
3737
38+ - 695 Max Area Of Island
3839- 200 Number Of Islands
3940- 133 Clone Graph
4041- 1 Two Sum
4142- 295 Find Median From Data Stream
42- - 1 Two Sum
4343
4444
4545---
8181GitHub
8282⏰ Last Sync
8383
84- 2026-07-03 14:03:07
84+ 2026-07-04 19:12:15
Original file line number Diff line number Diff line change 1+ {
2+ "submission_id" : " 2055926600" ,
3+ "question_id" : " 695" ,
4+ "title_slug" : " max-area-of-island" ,
5+ "language" : " python3" ,
6+ "language_verbose" : " Python3" ,
7+ "runtime" : " 22 ms" ,
8+ "memory" : " 20.7 MB" ,
9+ "status_code" : 10 ,
10+ "timestamp" : 1783178540
11+ }
Original file line number Diff line number Diff line change 1+ class Solution :
2+ def maxAreaOfIsland (self , grid : List [List [int ]]) -> int :
3+ rows = len (grid )
4+ cols = len (grid [0 ])
5+ maxArea = 0
6+
7+ def dfs (r ,c ):
8+ if (
9+ r < 0 or
10+ c < 0 or
11+ r >= rows or
12+ c >= cols or
13+ grid [r ][c ]== 0
14+ ):
15+
16+ return 0
17+ grid [r ][c ]= 0
18+ return (
19+ 1 + dfs (r + 1 ,c )
20+ + dfs (r - 1 , c )
21+ + dfs (r , c + 1 )
22+ + dfs (r , c - 1 )
23+ )
24+ for r in range (rows ):
25+ for c in range (cols ):
26+ if grid [r ][c ] == 1 :
27+ area = dfs (r ,c )
28+ maxArea = max (maxArea , area )
29+ return maxArea
Original file line number Diff line number Diff line change 11{
2- "total" : 122 ,
2+ "total" : 123 ,
33 "easy" : 63 ,
4- "medium" : 53 ,
4+ "medium" : 54 ,
55 "hard" : 6 ,
66 "languages" : {
7- "Python3" : 6
7+ "Python3" : 7
88 },
99 "recent_problems" : [
10+ {
11+ "id" : " 695" ,
12+ "title" : " Max Area Of Island"
13+ },
1014 {
1115 "id" : " 200" ,
1216 "title" : " Number Of Islands"
2226 {
2327 "id" : " 295" ,
2428 "title" : " Find Median From Data Stream"
25- },
26- {
27- "id" : " 1" ,
28- "title" : " Two Sum"
2929 }
3030 ],
3131 "last_problem" : {
32- "id" : " 200 " ,
33- "title" : " Number Of Islands " ,
32+ "id" : " 695 " ,
33+ "title" : " Max Area Of Island " ,
3434 "language" : " Python3" ,
35- "runtime" : " 252 ms" ,
36- "memory" : " 21.6 MB"
35+ "runtime" : " 22 ms" ,
36+ "memory" : " 20.7 MB"
3737 },
38- "last_sync" : " 2026-07-03 14:03:07 "
38+ "last_sync" : " 2026-07-04 19:12:15 "
3939}
You can’t perform that action at this time.
0 commit comments