Skip to content

Commit 346f5b6

Browse files
committed
resolve
2 parents 791f343 + 7488e4d commit 346f5b6

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

EPI/EPI.py

+20
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"""
44

55
<<<<<<< HEAD
6+
<<<<<<< HEAD
7+
=======
8+
9+
>>>>>>> 7488e4d602261a8615cebaf51ea6ebaac4ccb207
610
=======
711

812
>>>>>>> 7488e4d602261a8615cebaf51ea6ebaac4ccb207
@@ -19,12 +23,28 @@ def cc(n, denoms):
1923
#globalMin= minCoins
2024
return globalMin
2125

26+
<<<<<<< HEAD
2227
# print(cc(5, [1, 5, 10, 25]))
2328
# print(cc(33, [1, 5, 10, 25]))
2429

2530
# greedy algorithm, always pick the largest possible coin, subtract from n
2631
def greedyCC(n, denoms):
2732
pass
33+
=======
34+
print(cc(5, [1, 5, 10, 25]))
35+
print(cc(33, [1, 5, 10, 25]))
36+
37+
# greedy algorithm, always pick the largest possible coin, subtract from n
38+
def greedyCC(n, denoms):
39+
prev =0
40+
count =0
41+
while n != 0:
42+
n -= max(denoms) if max(denoms)<n
43+
count +=1
44+
return count
45+
46+
47+
>>>>>>> 7488e4d602261a8615cebaf51ea6ebaac4ccb207
2848

2949

3050
"""

EPI/EPI_ch5_arrays.py

+3
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ def partition_opt(arr, i):
5151
and update the array to represent N+1.
5252
"""
5353
<<<<<<< HEAD
54+
<<<<<<< HEAD
5455

5556

5657
def knapsack(items, weights, W):
5758

5859
=======
5960
>>>>>>> 7488e4d602261a8615cebaf51ea6ebaac4ccb207
61+
=======
62+
>>>>>>> 7488e4d602261a8615cebaf51ea6ebaac4ccb207
6063

0 commit comments

Comments
 (0)