Map to store the next character on the keyboard for every possible lowercase character
unordered_map < char , char > uMap ; for ( int i = 0 ; i < MAX ; i ++ ) { uMap [ CHARS [ i ] ] = CHARS [ ( i + 1 ) % MAX ] ; }