Find Transition Point

easy
1.You are given a sorted array containing only numbers 0 and 1.
 2.You have to find the transition point.
 3.Transition point is defined as a point where "0" ends and "1" begins.
 4.You have to complete the function transitionPoint() that should return the transition point.

Input Format

1.First line contains a single integer 'N'. 2.Second line contains 'N' space separated elements of the array.

Output Format

Return an Integer

Constraints

1 <= N <= 500000
 0 <= A[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
5
0 0 0 1 1
Output
3
Previous
Find Minimum In Rotated Sorted Array
Next
Guess Number Higher Or Lower

Related Questions