You are viewing a single comment's thread. Return to all comments →
JavaScript:
function icecreamParlor(m, arr) { for (let i = 0; i < arr.length; i++) { let balance = m - arr[i]; let find = arr.findIndex((num, index) => { return i != index && num === balance }) if(find != -1) { return [i + 1, find + 1] } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
JavaScript: