Can greedy be used to find the minimum number of notes to make 1000 from (1,5, 7 ) rupee notes

I think answer should be YES, as first we can take 142 7 rupee coin, then 1 five rupee coin and one 1 rupee coin
Total coins=142+1+1=144(according to greedy algorithm)
and the answer would be same using dynamic programming as well.

@pulkit_99 Yes, greedy will work for this specific case.
and yes the question specifically asks for this case, so the answer should be yes.
I’ll check with the problem setter.
And greedy may not always work, lets say if you want to make 10 from (1,5,7) rs notes.