Company: Rippling
Difficulty: easy
Final Discounted Price A shopkeeper arranges items in a list for a sale. Working from the left, each item is sold at its full price minus the price of the first item to its right that is of equal or lower price . If no such item exists, the current item is sold at its full price. You are given the prices of the n items in the order they appear in the list. Print the sum of the final cost of all items, then, on the next line, print the space-separated 0 -based indices of the items that are sold at full price, in ascending order. Note that the last item in the list always has nothing to its right, so it is always sold at full price. The second line therefore always contains at least one index. Function Description Complete the function finalPrice with the following parameter: int prices[n] : an array of item prices ### Returns None. Instead, print the total cost of all items on the first line. On the second line, print a space-separated list of integers representing the indices of the it