fork download
  1. def getMoneySpent(keyboards, drives, b):
  2. keyboards.sort(reverse = True)
  3. drives.sort(reverse = True)
  4. summ = 0
  5. maxP = -1
  6. for i in range(len(keyboards)):
  7. for j in range(len(drives)):
  8. summ = keyboards[i] + drives[j]
  9. if summ <= b and summ > maxP:
  10. maxp = summ
  11. return maxp
  12.  
Success #stdin #stdout 0.02s 7040KB
stdin
Standard input is empty
stdout
Standard output is empty