Bloomberg New grad 店面挂

https://leetcode.com/problems/alien-dictionary/ 变种

Given a string and an order, sort the string by that order, so for example, if the string is: klgbycjghd and the order is gbjgkljhd the final sorted string would be gbjgkljhdy. There are some other restrictions that make the problem harder.

Wasn’t expecting an LC hard, had to clarify a lot of things before I fully understood the question and then came up with a custom sort approach through a map. Wasn’t the most optimal approach (hashing and bucket sort, which I couldn’t recall in time).