Choose the current character
if ( s [ pos ] . charCodeAt ( ) - ' ' . charCodeAt ( ) + 1 != prev ) { val = Math . max ( val , 1 + calculate ( pos + 1 , s [ pos ] . charCodeAt ( ) - ' ' . charCodeAt ( ) + 1 , s ) ) ; }