Find the Difference Problem
Find the Difference Problem — ExecCode Easy DSA Practice
Solve the Find the Difference problem on ExecCode. Free online easy DSA practice in Bit Manipulation. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given two strings s and t. Your task is to compute the required answer and return the letter that was added to t. String t is generated by random shuffling string s and then add one more letter at a random position.
Examples
Input {"s": "abcd abcde", "t": ""}; Output e. Input {"s": "a aa", "t": ""}; Output a. Input {"s": "xyz xyza", "t": ""}; Output a
Constraints
0 <= s.length <= 1000 t.length == s.length + 1 s and t consist of lowercase English letters.
Practice Find the Difference free on ExecCode. Browse DSA problems, topic map, and placement guides.