Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # you can write to stdout for debugging purposes, e.g.
- # print("this is a debug message")
- from extratypes import Tree # library with types used in the task
- def visableNum(T, currentMax = 0):
- if T == None:
- return 0
- count = 0
- if T.x >= currentMax:
- count = 1
- currentMax = T.x
- return count + visableNum(T.l, currentMax) + visableNum(T.r, currentMax)
- def solution(T):
- # write your code in Python 3.6
- return visableNum(T)
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement