Description
You are given two strings s and t. String t is generated by random shuffling string s and adding one extra letter at a random position. Return the letter that was added to t.
Examples
Input:
s = "abcd", t = "abcde"Output:
"e"Explanation:
'e' was added.
Input:
s = "", t = "y"Output:
"y"Explanation:
String s is empty and t has one character 'y', so the added letter is 'y'.
Input:
s = "xyz", t = "zyxm"Output:
mExplanation:
String t is a shuffled version of string s with letter 'm' added. Even though the order is different (xyz vs zyx), the extra character 'm' can still be identified.
Constraints
- •
0 ≤ s.length ≤ 1000