Find the Difference

Advanced

Welcome to the find-the-difference challenge! In this task, you will write a function that helps us find extra letters. Imagine you have two strings where the second string is the same as the first one but with one additional letter. Your job is to find out what that extra letter is.

It’s like a game of "Spot the Difference" in the land of letters!

How does the function work?

You need to implement a function named find_the_difference that will take two input strings, s and t. Here, t is identical to s but with one extra letter. You have to determine that extra letter and return it.

Examples:

find_the_difference("abcd", "abcde") # returns 'e' find_the_difference("", "y") # returns 'y' find_the_difference("a", "aa") # returns 'a' find_the_difference("abc", "cabd") # returns 'd'

As you can see, this is a fun way to practice string manipulation and thinking logically! Let’s hop into the challenge and solve it.

Geek
Inputs

Arg 1:

"abcd"

Arg 2:

"abcde"
Expected Output
"e"
Actual Output