Unless I'm off base, why is this not optimal? The DP solution looks like it's maximizing lower value coins while this is doing the opposite (which leads to an overall minimization of coins used).
Edit: I see why now, I am falsely assuming "normal" coin values. Greedy would not work in e.g.
V=[1,18,20]
M=36
In greedy, it would be C=17 (20 +. 17 ones), whereas do looks to give 2. I misunderstood the relation.