Sort by

recency

|

2408 Discussions

|

  • + 0 comments
        TreeSet<Integer> set = new TreeSet<>();
    
        for(int i = 0; i < keyboards.length; i++) {
            for(int j = 0; j < drives.length; j++) {
                set.add(keyboards[i] + drives[j]);
            }
        }
    
        return set.floor(b) == null ? -1 : set.floor(b);
    
  • + 0 comments
    def getMoneySpent(keyboards, drives, b):
        #
        # Write your code here.
        #
        
        count = 0 
        max_ = -1
        for i in drives: 
            
            for j in keyboards: 
                
                count = i + j
                if count > max_ and count <= b :
                    max_ = count
                
        return max_
    
  • + 0 comments

    I love checking out new gadgets at my local electronics shop—always something cool to find! Having the latest tech makes life easier, especially when it comes to keeping things tidy. Shoutout to home cleaners Inverness for helping me keep my space spotless so I can actually enjoy my devices. Clean home, happy vibes!

  • + 0 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

  • + 0 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