Skip to content

Commit

Permalink
Challenge_5
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbotello committed Jan 5, 2017
1 parent 7edefad commit 1e81805
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
21 changes: 21 additions & 0 deletions challenge_5/python/alexbotello/FindTheDifference.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from collections import Counter


class Solution:
def findTheDifference(self, s, t):

s = dict(Counter(s))
t = dict(Counter(t))

for key in t.keys():
if key not in s.keys():
s[key] = 0
if s[key] - t[key] <= -1:
return key


if __name__ == '__main__':

test_case = Solution()
s, t = [input() for _ in range(2)]
print('\n' + test_case.findTheDifference(s, t))
18 changes: 18 additions & 0 deletions challenge_5/python/alexbotello/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Find The Difference
###### Language Version (Python 3.6.0)

### Compile

```
python test.py
```
```
python FindTheDifference.py
```

### How To Use

Run test.py to check against unit test

Run FindTheDifference.py to test your own implementation
- Enter two lines of input, both must be a lowercase string
66 changes: 66 additions & 0 deletions challenge_5/python/alexbotello/test.py

Large diffs are not rendered by default.

0 comments on commit 1e81805

Please sign in to comment.