You are viewing a single comment's thread. Return to all comments →
code in python def getMoneySpent(keyboards, drives, b): su=[k+d for k in keyboards for d in drives if (k+d)<=b] return sorted(su)[-1] if su else -1
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Electronics Shop
You are viewing a single comment's thread. Return to all comments →
code in python def getMoneySpent(keyboards, drives, b): su=[k+d for k in keyboards for d in drives if (k+d)<=b] return sorted(su)[-1] if su else -1