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