Driver code
static public void Main ( ) { int [ ] arr = { 1 , 2 , 2 , 2 , 1 , 1 } ; int n = arr . Length ; int ans = minSteps ( arr , 0 , 0 , n ) ; if ( ans >= 9999999 ) { Console . WriteLine ( - 1 ) ; } else { Console . WriteLine ( ans ) ; } } }