Minimum Cost of Buying Candies With Discount
Given an array of candy costs, find the minimum cost of buying all candies with a discount. You can choose one candy and get another one for free, but the free candy must have a cost less than or equal to the minimum cost among the candies you purchase.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)