Find the first occurrence of 1 in a sorted array of 0s and 1s; then solve it in one iteration.
Asked in the Technical Round 1 stage. Standard binary search was discussed first, followed by the one-iteration solution.
Implement find_first_one(nums), where nums is a non-empty sorted list containing only 0 and 1. Return the zero-based index of the first 1, or -1 if the array contains no 1.
def find_first_one(nums):