Skip to content

Commit

Permalink
Hakerrank
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-carje committed Sep 25, 2020
1 parent ed85457 commit 36579d2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
21 changes: 21 additions & 0 deletions Algorithms/Implementation/E07-Sales_by_Match.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Problem
# https://www.hackerrank.com/challenges/sock-merchant/problem

# Score solution: 10.00

# -------------------------------------------
# Soluction 1
def sockMerchant(n, ar):
count = 0
for i in set(ar):
count += int(ar.count(i) / 2)
return count
# -------------------------------------------
# Test
# Input
n = 9
ar = [10, 20, 20, 10, 10, 30, 50, 10, 20]
print(sockMerchant(n, ar))

# Output
# 3
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
* [Divisible sum pairs](https://www.hackerrank.com/challenges/divisible-sum-pairs/problem) | [Python solution](Algorithms/Implementation/E03%-%Divisible%Sum%Pairs.py) | Score:10
* [Mirgratory Birds](https://www.hackerrank.com/challenges/migratory-birds/problem) | [Python solution](Algorithms/Implementation/E04%Migratory%Birds.py) | Score:10
* [Day of the programmer](https://www.hackerrank.com/challenges/day-of-the-programmer/problem) | [Python solution](Algorithms/Implementation/E05%Day%of%the%Programmer.py) | Score:10
* [Bon-appetit](https://www.hackerrank.com/challenges/bon-appetit/problem) | [Python solution](Algorithms/Implementation/E06_bon-appetit.py) | Score:10
* [Bon-appetit](https://www.hackerrank.com/challenges/bon-appetit/problem) | [Python solution](Algorithms/Implementation/E06_bon-appetit.py) | Score:10
* [Sales by Match](https://www.hackerrank.com/challenges/sock-merchant/problem) | [Python solution](Algorithms/Implementation/E07-Sales_by_Match.py) | Score:10

0 comments on commit 36579d2

Please sign in to comment.