minimum and second_minimum, with the first two prices in the array after comparing them.minimum, update second_minimum to minimum and minimum to the current price.second_minimum, update second_minimum to the current price.minimum and second_minimum as min_cost.min_cost is less than or equal to money, return money - min_cost as the leftover money.min_cost is greater than money, return money as there is no way to buy two chocolates without going into debt.