-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcardtrading.py
More file actions
38 lines (25 loc) · 783 Bytes
/
cardtrading.py
File metadata and controls
38 lines (25 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from collections import Counter
def kcombo(cardDeck):
counterz = Counter(cardDeck)
# TODO
#check if there are at least 2 values for k distinct
#card
return False
deck, cards, combos = [int(i) for i in input().split()]
cardDeck = [int(i) for i in input().split()]
print(cardDeck)
cardSellBuy = []
for x in range(0, cards):
buy, sell = [int(i) for i in input().split()]
cardSellBuy.append((buy,sell))
print(" maxSell {} cardSell {} minBuy {} cardBuy {}".format(maxSell, cardSell, minBuy, cardBuy))
combo = False
money = 0
maxMoney = 0
while (not combo): #while combo is not reached
for i in cardSellBuy:
money -= cardSellBuy[i][1]
cardDeck.remove(i+1)
combo = kcombo(cardDeck)
#
#hile (deck does not have k combos):