You are viewing a single comment's thread. Return to all comments →
Javascript Solution
function icecreamParlor(m, arr) { for (let i = 0; i < arr.length; i++) { const remainder = m - arr[i]; const secondIndex = arr.indexOf(remainder); if (secondIndex != -1 && secondIndex != i) { return [i+1, secondIndex+1].sort((a,b) => a - b); } } }
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 Solution