converting the sub - string starting from index ' i ' and having length ' len ' to int and checking if it is greater than X or not
int num = Integer . parseInt ( S . substring ( i , i + len ) ) ; if ( num > X ) count ++ ; } } } return count ; }