Skip to content

Commit ee78e9e

Browse files
author
FLotfiGit
committed
update
1 parent 9c7d6d2 commit ee78e9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

3sum_closest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def sum_closest(L, num_k, target):
2121
prev = {}
2222
max_t = sum([x for x in L if x > 0])
2323
min_t = sum([x for x in L if x <= 0])
24-
print 'target range: [%d, %d]' %(min_t, max_t)
24+
print('target range: [%d, %d]' %(min_t, max_t))
2525

2626
# Initialization:
2727
# S(0,any,any) = False
@@ -57,7 +57,7 @@ def sum_closest(L, num_k, target):
5757
next_i,next_k,next_t = prev[(i,k,t)]
5858
if next_k == k-1: output.append(L[next_i])
5959
i,k,t = next_i,next_k,next_t
60-
print 'output:', output, 'sum(output):', sum(output)
60+
print('output:', output, 'sum(output):', sum(output))
6161
return output
6262

6363

0 commit comments

Comments
 (0)