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.
a,b1=keyboards,drives
s=[]
for i in range(len(a)):
for j in range(len(b1)):
if a[i]+b1[j]<=b:
s.append(a[i]+b1[j])
if len(s)>1:
return max(s)
else:
return -1
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 →
a,b1=keyboards,drives s=[] for i in range(len(a)): for j in range(len(b1)): if a[i]+b1[j]<=b: s.append(a[i]+b1[j]) if len(s)>1: return max(s) else: return -1