📅  最后修改于: 2022-03-11 15:02:10.936000             🧑  作者: Mango
// electronics shop hackerrank solution javascript
function getMoneySpent(keyboards, drives, b) {
/*
* Write your code here.
*/
let sum = [];
let max = 0;
for(let i=0; i max){
max = sum[k];
}
}
}
if(max !== 0 && max <=b){
return max;
}else{
return -1;
}
}