We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Counting Valleys
Counting Valleys
Sort by
recency
|
4106 Discussions
|
Please Login in order to post a comment
can you help to integrate this algorithem script with my site movies streaming app page? i want to use on it my wordpress website.
python
def countingValleys(steps, path): up = 0 down = 0 valley = 0 for i in range(steps): if path[i]=='U': up +=1 elif path[i] =='D': down +=1 if (up == down and path[i]=='U'): valley +=1 return valley
javascript solution
function countingValleys(steps, path) { let valleys = 0; let altitude = 0;
}
Here is my c++ solution you can find the video here : https://youtu.be/fgJ-i8RJ1Qw