Question 1194100
.


My previous solution in this post was incorrect, so I deleted it.


The logic I used was defective - - - thanks to Edwin, who detected and noticed it.



Use Edwin' solution, which is correct.