Source: https://babel.csfoy.ca/profs/maverreault/NYC/Exercices Sol/Ch2_Exercices Solutions.pdf