We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
def getMoneySpent(keyboards, drives, b):
#
# Write your code here.
#
sums = [keyboards[i]+ drives[j] if (keyboards[i]+ drives[j]) <= b else -1 for i in range(len(keyboards)) for j in range(len(drives))]
return max(sums)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Electronics Shop
You are viewing a single comment's thread. Return to all comments →
def getMoneySpent(keyboards, drives, b): # # Write your code here. # sums = [keyboards[i]+ drives[j] if (keyboards[i]+ drives[j]) <= b else -1 for i in range(len(keyboards)) for j in range(len(drives))] return max(sums)