Skip to content

Latest commit

 

History

History

challenge_5

Find the Difference

Premise

  • Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was added in t.

Example:

Input: s = "abcd" t = "abcde"

Output: e

Explanation: 'e' is the letter that was added.

  • I wrote a unit test for python users to accompany this challenge. Feel free to write your own unit tests so that others can use it to better their code! The test is under the folder mjuiuc

Unit testing!

  • Name your solution.py file FindTheDifference.py
  • Encapsulate your code into a Solution class
  • In that class, write all of your logic in a function named: findTheDifference(s,t) where s and t are the two strings as prev stated.

If you did all of that correctly, then you should be able to use my test.py file. All you have to do is run that instead of you solution.py

This is the first unit test I've written in python so go easy on the criticism ;) but it is still indeed welcome.

Testing

Expected input:

abcd
abcde

Expected output:

e