Driver code
int main ( ) { int arr [ ] = { 1 , 2 , 2 , 2 , 1 , 1 } ; int n = sizeof ( arr ) / sizeof ( int ) ; int ans = minSteps ( arr , 0 , 0 , n ) ; if ( ans >= 9999999 ) cout << -1 ; else cout << ans ; }