Ice Cream Parlor

  • + 0 comments

    Basically Two Sum

    def icecreamParlor(m, arr):
        d = dict()
        for idx, price in enumerate(arr):
            if m - price in d:
                return [d[m - price], idx + 1]
            d[price] = idx + 1
        
        return [0,0]