fill all stated with - 1 when only one element
for ( int i = 0 ; i < MAX ; i ++ ) { for ( int j = 0 ; j < MAX ; j ++ ) dp [ i , j ] = - 1 ; } if ( n == 1 ) return 0 ; else return countRemovals ( a , 0 , n - 1 , k ) ; }