Selecting A combination of minimum cost

前端 未结 5 1637
天命终不由人
天命终不由人 2020-12-10 09:07

I have data of different items in a different restaurants

    Rest    Item     Price
    ----------------------
    ABC     dosa      14
    ABC     idly             


        
5条回答
  •  北荒
    北荒 (楼主)
    2020-12-10 09:56

    First you need to make all the possible combination of 3 items corresponding to different restaurents like :

    XYZ     dosa+idly+upma 52
    XYZ     dosa+upma+idly 42
    XYZ     dosa+idly+upma 40
    

    Same the above case with all the restaurants.

    Then sort the price and let the minimum price restra WIN.

提交回复
热议问题