Ninja technique🥷 to ACE DSA Interviews.
void findMin(int v)
{
int deno[] = {1, 2, 5, 10, 20, 50, 100, 500, 1000};
int n = 9;
vector<int> ans;
for (int i = n - 1; i >= 0; i--)
{
while (v >= deno[i])
{
v -= deno[i];
ans.push_back(deno[i]);
}
}
int len = ans.size();
for (int i = 0; i < len; i++)
cout << ans[i] << " ";
}