Given two strings containing only lowercase letters and no spaces, the result should be the shorter string, followed by an underscore, followed by the longer string with the first instance of a character removed for each character it contains that is in the shorter string.
You can assume the strings will always be different lengths.
sale salinewater Result: sale_inwater (only the first 'a' in salinewater is removed) jostling juggle Result: juggle_ostin (juggle is the shorter string) juggle juggler Result: juggle_r (a 'g' is removed for every 'g' in the shorter string)
This is code-golf, so shortest answer in bytes wins!
juggle_r(remove for each character instance) or
juggle_gr(remove for each distinct character)? \$\endgroup\$