Looping over the string characters and finding strings less than that character
for ( int i = 0 ; i < len ; i ++ ) { count += ( s . charAt ( i ) - ' a ' ) * Math . pow ( 26 , len - i - 1 ) ; } return count ; }