an algorithm for shopping cart, the general flow is:
know the price and importance level of each item (1 to 5 are the most important). In the case of a limited amount, you can buy one or more goods, each with a quantity of 1, achieving the highest points (price x importance).
raise chestnut:
A Commodity: price 100RMB, important level 3
B Commodity: price 350, important level 2
C Commodity: price 800, important level 5
D Commodity: price 550, important level 1
Total amount of account: 3000 yuan
introduce four items of ABCD, and figure out which one or several items to buy has the highest score. Who has the idea of algorithm? Thank you!