The implementation and the explanation of the algorithm are somewhat different
When he explains the algorithm he begins with all "heads" and counting 2 by 2. The python code begins all "tails" counting 1 by 1. This ends up with the same result obviously because the first iteration sets the list into all "heads". In addition, he switches up to n=qty of coins in the explanation and in the code he goes up to n=qty-1. Since he ends up getting a "tail" in the last position this doesnt screw up the final result where only "heads" are selected.
Hi daniel,
thanks for pointing this out! There is a slight difference, indeed, hopefully other students will be able to follow along, as well.
Best,
Elitsa
Is there no particlar stepwise coding process in solving coding questions? For beginners like me, I think a step wise approach will help.
The course is great, but I still need to watch the lessons over and over the grasp the details more