Ice Cream Parlor

  • + 0 comments
    def icecreamParlor(m, arr)
        seen = []
        for i in 0...arr.length
            comp = m - arr[i]
            if seen.include? comp
                ind = [seen.index(comp)+1, i+1]
                break
            end
            seen.push arr[i]
        end
        
        ind
    end