Find Transition Point

easy
1. Given a sorted array containing only 0s and 1s, find the transition point.
2. Transition Point is defined as 1's starting point.
3. If there is no transition point, return -1.

Input Format

Input is managed for you

Output Format

Output is managed for you

Constraints

1 <= N <= 500000
0 <= arr[i] <= 1

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
6
0 0 0 0 1 1
Output
4
Previous
Distinct Absolute Array Elements
Next
Super Ugly Number

Related Questions