What is a Greedy Approach? - Algorithms for Coding Interviews in Java

Refert the article discussing Greedy Approach here -->

The real life example discusses a Piggy Bank with a capacity of 6 and the choice of items with (value,weight) combination being A(2,2), B(10,2) and C(100,2). The example chooses C+B+1/2A whereas the value can be maximized by taking 2C. My confusion why did we chose C+B+1/2A over 2C.

  • Is there any constraint that we need to have only one item of each type ?