#K91577. Find the Extra Character

    ID: 38006 Type: Default 1000ms 256MiB

Find the Extra Character

Find the Extra Character

You are given two strings, s and t. It is guaranteed that the string t is formed by taking the string s and inserting extra occurrences of exactly one additional character. In other words, if you let f(c, s) and f(c, t) denote the frequency of a character c in s and t respectively, then there exists a unique character x such that:

\(f(x, t) \neq f(x, s)\)

Your task is to determine and output this extra character.

Note: The strings may be large. It is recommended to use efficient methods to compute character frequencies.

inputFormat

The input consists of two lines:

  • The first line contains the string s.
  • The second line contains the string t, which is derived from s by adding extra occurrences of one character.

outputFormat

Output a single line containing the extra character that appears in t with a different frequency compared to s.

## sample
abcde
abcedd
d