We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cd787d commit 257e85eCopy full SHA for 257e85e
HackerRank-Electronics Shop/Electronics_Shop.py
@@ -0,0 +1,28 @@
1
+#!/bin/python3
2
+
3
+import os
4
+import sys
5
6
+def getMoneySpent(keyboards, drives, b):
7
+ return max([sum([x,y]) for x in keyboards for y in drives if sum([x,y]) <= b]+[-1])
8
9
+if __name__ == '__main__':
10
+ fptr = open(os.environ['OUTPUT_PATH'], 'w')
11
12
+ bnm = input().split()
13
14
+ b = int(bnm[0])
15
16
+ n = int(bnm[1])
17
18
+ m = int(bnm[2])
19
20
+ keyboards = list(map(int, input().rstrip().split()))
21
22
+ drives = list(map(int, input().rstrip().split()))
23
24
+ moneySpent = getMoneySpent(keyboards, drives, b)
25
26
+ fptr.write(str(moneySpent) + '\n')
27
28
+ fptr.close()
0 commit comments