Skip to content

Commit

Permalink
Mon Nov 04 07:17:34 UTC 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
sbx_user1051 committed Nov 4, 2024
1 parent 2d27316 commit 4eac54b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/solutions/CHK/checkout_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,9 @@ def checkout(skus):
}
}

if ',' in skus:
units = skus.split(',')
else:

# This is for the case where the input is a series of letters in a word
units = list(skus)
units = list(skus)

if len(set(units).difference(set(priceDict.keys()))) > 0:
return -1
Expand Down Expand Up @@ -210,7 +208,7 @@ def checkout(skus):
basket.subtract({deductedItems[deductedItemsIndex]: numRemoved})
deductedItemsIndex += 1


print(f'Added val of {groupDeal['price']} for group deal: {groupDealCombo} basket now: {basket}')
groupDealComboExists = sum(basket[item] for item in groupDealCombo.keys()) > groupDeal['amount']

Expand Down Expand Up @@ -258,3 +256,4 @@ def checkout(skus):




0 comments on commit 4eac54b

Please sign in to comment.