Prefix Sum Array for X + 1 digit
int prefix [ size1 ] = { 0 } ; for ( int j = 0 ; j < size1 ; j ++ ) { if ( newtest [ j ] == y + 48 ) { prefix [ j ] ++ ; } } for ( int j = 1 ; j < size1 ; j ++ ) { prefix [ j ] += prefix [ j - 1 ] ; } int count = 0 ; int firstcount = 0 ;