yes
Time Limit: 1 seconds
Memory Limit: 128 MB
Rating: 900
Problem StatementGiven an array of numbers, $N$, with $0$ being a path and $1$ being an obstacle, find out how many times Mario will need to jump to reach the end of the array. Mario can jump over any amount of obstacles in one go, but he can’t jump over a path. E.g given the array $[0,1,1,0,0,1,0,1,0,0,1,0]$ mario will need to make 4 jumps to get to the end
InputThe first line contains string $N$, made up of characters $0$ and $1$.
OutputOutput the answer described in the Problem Statement.
Sample CasesSample Input 1: 0011110110 Sample Output 1: 2 Sample Input 2: 100000101011100 Sample Output 2: 4Explanation
Not available for this problem.
SourcesKL Coding Cup March 2023 > Super Mario > Problem 3
Submit | Back