Robinhood interview question

some string problems, u can use map or other java libs.