Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6043c37

Browse files
update EPI
1 parent 172882f commit 6043c37

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

‎EPI/EPI.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
solutions to problems in EPI
33
"""
44

5-
65
#naive recursion
76
def cc(n, denoms):
87
minCoins =100
@@ -16,19 +15,12 @@ def cc(n, denoms):
1615
#globalMin= minCoins
1716
return globalMin
1817

19-
print(cc(5, [1, 5, 10, 25]))
20-
print(cc(33, [1, 5, 10, 25]))
18+
# print(cc(5, [1, 5, 10, 25]))
19+
# print(cc(33, [1, 5, 10, 25]))
2120

2221
# greedy algorithm, always pick the largest possible coin, subtract from n
2322
def greedyCC(n, denoms):
24-
prev =0
25-
count =0
26-
while n != 0:
27-
n -= max(denoms) if max(denoms)<n
28-
count +=1
29-
return count
30-
31-
23+
pass
3224

3325

3426
"""

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /