Draft

The first true

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

Stats:

CreatedMar 3, 2020
Warriors Trained175
Total Skips30
Total Code Submissions476
Total Times Completed49
Python Completions49
Total Stars3
% of votes with a positive feedback rating77% of 31
Total "Very Satisfied" Votes21
Total "Somewhat Satisfied" Votes6
Total "Not Satisfied" Votes4
Total Rank Assessments30
Average Assessed Rank
6 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • alldne Avatar
  • Blind4Basics Avatar
Ad