7 kyu
Counting Valleys
843 of 1,881Valefar
Description:
You need count how many valleys you will pass.
Start is always from zero level.
Every time you go down below 0 level counts as an entry of a valley, and as you go up to 0 level from valley counts as an exit of a valley.
One passed valley is equal one entry and one exit of a valley.
s='FUFFDDFDUDFUFUF'
U=UP
F=FORWARD
D=DOWN
To represent string above
(level 1) __
(level 0)_/ \ _(exit we are again on level 0)
(entry-1) \_ _/
(level-2) \/\_/
So here we passed one valley
Algorithms
Strings
Similar Kata:
Stats:
Created | Oct 18, 2019 |
Published | Oct 18, 2019 |
Warriors Trained | 3947 |
Total Skips | 70 |
Total Code Submissions | 8101 |
Total Times Completed | 1881 |
JavaScript Completions | 843 |
Haskell Completions | 43 |
C++ Completions | 273 |
Python Completions | 694 |
Rust Completions | 59 |
RISC-V Completions | 14 |
C Completions | 41 |
Total Stars | 44 |
% of votes with a positive feedback rating | 94% of 372 |
Total "Very Satisfied" Votes | 337 |
Total "Somewhat Satisfied" Votes | 28 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 22 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |