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