Ice Cream Parlor

  • + 2 comments

    How are duplicates not a concern? If you have an array of [1, 2, 5, 2] and the sum is 4, then answer answer indexes are 1 and 4. When you search for the elements, you will always find the first element, and end up returning 1 and 1 instead. In otherwords, the index of the first occurence of one of the answers.