Meta Logistics compares text fields from two logistics systems and needs to identify word occurrences that do not match across the strings. Write a function that returns unmatched words while preserving their left-to-right order.
A word is a maximal sequence of non-whitespace characters. Matching is case sensitive, so Route and route are different words. Each occurrence in one string can match at most one identical occurrence in the other string. Return unmatched occurrences from the first string in their original order, followed by unmatched occurrences from the second string in their original order.
first and second.Example 1
Input: first = "Meta Logistics ships parcels", second = "Meta Logistics tracks routes"
Output: ["ships", "parcels", "tracks", "routes"]
Meta and Logistics match. The remaining words occur in only one string.
Example 2
Input: first = "Route route route", second = "route route"
Output: ["Route", "route"]
Route differs from route, and one lowercase route occurrence remains unmatched.
0 <= len(first), len(second) <= 10^52 * 10^5.def unmatched_words(first, second):