You are viewing a single comment's thread. Return to all comments →
def countingValleys(steps, path): level=0 valley=0 for i in path: if i=="U": level+=1 if level==0: valley+=1 else: level-=1 return valley
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Valleys
You are viewing a single comment's thread. Return to all comments →