- 292
Statement
Goal
Given a list ofThe expected result is the minimum number of steps required to obtain a sorted list.
Input
Line 1: an integer N.
Line 2: a list of N numbers that can take the values0 or 1 .
Line 2: a list of N numbers that can take the values
Output
Line 1 : The minimum number of steps to regroup all the 1 at the beginning of the list.
Constraints
1 ≤ N < 500
Example
Input
5 1 0 1 0 1
Output
1
A higher resolution is required to access the IDE