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