DE
Size: a a a
DE
AK
DE
AK
p
Array.prototype.indexOf = function (target) {
let i = 0
while(i < this.length) {
if(this[i] === target) return i
i++
}
return -1
}
p
AK
p
YP
AK
p
T
var maximumWealth = function(accounts) {
return Math.max(...accounts.map(el => el.reduce((acc, el) => acc + el)))
};
DE
DE
p
const maximumWealth = accounts => {
let max = []
for(let i = 0; i < accounts.length; i += 1){
max.push(accounts[i].reduce((acc, item) => acc + item, 0))
}
return Math.max(...max)
}
YP
YP
T