how to write a code of this problem
Infinite Quarters
Think this problem this way, First, all the coins are in pile A. Move 20 coins to pile B.
If there are now N tails in pile A, there must be (20 - N) tails in pile B, and thus N heads in pile B.
Flip all coins in pile B. There must now be N tails in pile B.
Done. It’s just a mathematical problem. try to write it’s program , you would be able to write it on your own.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.