Draft
The first true
49alldne
Description:
You are given an array of boolean values, starting with zero or more occurences of False
, followed by zero or more occurences of True
.
Goal
- Find the first
True
and return its index - If there is no
True
, return-1
.
Example
[False, False, False, True, True, True, True] # return 3
[False, False, False, True] # return 3
[False, True] # return 1
[True] # return 0
[] # return -1
[False, False, False, False] # return -1
Note
- The maximum input size is 200000000 for python.
- "A certain module" has been forbidden...
Algorithms
Similar Kata:
Stats:
Created | Mar 3, 2020 |
Warriors Trained | 175 |
Total Skips | 30 |
Total Code Submissions | 476 |
Total Times Completed | 49 |
Python Completions | 49 |
Total Stars | 3 |
% of votes with a positive feedback rating | 77% of 31 |
Total "Very Satisfied" Votes | 21 |
Total "Somewhat Satisfied" Votes | 6 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 30 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |