You are viewing a single comment's thread. Return to all comments →
can any one can write simpler than this "python" land=0
valley=0 for i in s: if i=='U': land+=1 if i=='D': land+=-1 if land==0 and i=='U': valley+=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 →
can any one can write simpler than this "python" land=0