Change Making Problem using bruteforce and greedy algorithm