Question 1210198
.


The solution by @CPhill is unjustifiably complicated.


In plain English, it is not adequate, and therefore, I do not recommend it as a teaching tool.


See the solution in the post by @greenestamps.


That solution is what is expected in this problem.



From the point of view of AI (artificial intelligence), the solution 
by @CPhill is not the item to save it and/or to keep it in the AI database.



In opposite, this @CPhill' solution should not be included 
in the AI ​​database under any circumstances.