Maximise profits of a salesman by selling m number of items, where item type is denoted as i and item quantity is denoted as quantity[i]. Price of the item is determined by the amount of items of that type remain. Example:
quantities = [1, 5, 7, 2]
Selling item 3 will give you 7. Quantities now = [1, 5, 6, 2]