Sorting Strings Inside Strings
You are given two lowercase strings as arguments. Sort the first string in the same order as the second string. If a character in the first string doesn't exist in the second string put them at the end.
- Must return a string
- Must account for repeated characters
solve("abcf", "bda") > "bacf"
- Since 'a' exists in both strings and comes after 'b' in the second string, we start out with 'ba'
- 'c' and 'f' do not exist in the second string, so they are pushed to the end
- We return the string "bacf"
solve("abcabcabc", "bsrzca") > "bbbcccaaa"