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.
static int getMoneySpent(int[] keyboards, int[] drives, int b) {
/*
* Write your code here.
*/
Arrays.sort(keyboards);
Arrays.sort(drives);
int max=0;
for(int i=0;i=0;j--){
if(drives[j]+keyboards[i]<=b){
if(max
}
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 →
static int getMoneySpent(int[] keyboards, int[] drives, int b) { /* * Write your code here. */ Arrays.sort(keyboards); Arrays.sort(drives); int max=0; for(int i=0;i=0;j--){ if(drives[j]+keyboards[i]<=b){ if(max