Uber Interview Question

Algorithm question of string and hash