Leetcode #791 Custom Sort String
This question is not too difficult.
Thought process:
First, we can find all occurrences of s based on order and replace with a space since we've used it
Replace the spaces and append the remaining characters to the result set.
Time complexity: O(...
michelletanpy.hashnode.dev1 min read