- Beta Can T Read The Text Switch Theme 5 Maximum Profit A Shop Owner In The City Of Hackerland Has N Items For Sale Th 1 (50.63 KiB) Viewed 75 times
BETA Can't read the text? Switch theme 5. Maximum Profit A shop owner in the city of Hackerland has n items for sale. Th
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
BETA Can't read the text? Switch theme 5. Maximum Profit A shop owner in the city of Hackerland has n items for sale. Th
BETA Can't read the text? Switch theme 5. Maximum Profit A shop owner in the city of Hackerland has n items for sale. The items are numbered from 1 to n. The th item is in category and has a selling price of price. The owner wishes to sell these items in some order. The profit made on the sale of an item is equal to the product of the price of that item and the number of different categories whose items have been sold before (including this item's category). Find the maximum possible total profit that can be made by selling the items in the optimal order. Example Consider n = 4, category=[3, 1, 2, 3] and price = [2, 1, 4, 4]. One of the optimal order in which them items can be sold are: First, sell the 2nd item; category[2] = 1.