I didn’t read the solution, but that kind of a brain teaser sounds like something a few fictitious famous men may have tried.
Sherlock Holmes Sir Lawrence of Arabia Macguyver (sp) Clutch Cargo (OK, Boomer!)
There was a good one on Columbo.