LeetCode gives you an array of log strings. Each log has an identifier followed by words (letter-logs) or digits (digit-logs). Amazon asks this to test custom sorting with multi-criteria comparators.
Reorder so all letter-logs come before digit-logs. Letter-logs are sorted lexicographically by content, then by identifier as a tiebreaker. Digit-logs keep their original order.
For example, ["dig1 8 1 5 1", "let1 art can", "dig2 3 6", "let2 own kit dig", "let3 art zero"] becomes ["let1 art can", "let3 art zero", "let2 own kit dig", "dig1 8 1 5 1", "dig2 3 6"].
Think about how you'd separate the log types and what comparator logic the letter-logs need.
Constraints: , log length to .