Skip to content

Commit 82dfc4f

Browse files
authored
Create 513.py
1 parent ccbb426 commit 82dfc4f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

500-1000/513.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution(object):
2+
def findBottomLeftValue(self, root):
3+
queue = deque([root])
4+
leftmost_value = None
5+
6+
while queue:
7+
node = queue.popleft()
8+
9+
leftmost_value = node.val
10+
11+
if node.right:
12+
queue.append(node.right)
13+
if node.left:
14+
queue.append(node.left)
15+
16+
return leftmost_value

0 commit comments

Comments
 (0)