Uber interview question

Algorithm question of string and hash