Morris Dovey (in FFOvg.3$ XXXX@XXXXX.COM ) said:
| It's not really a difficult problem; but the answer would depend on
| what you mean by "efficiency". Are you looking for the smallest code
| footprint - or are you looking for fastest execution time?
I thought it might be an interesting exercise. Including some #defines
to parameterize the problem, the solution took fewer than 2 dozen
statements. It was compact _and_ fast.
Pleased with myself, I leaned back and thought about possible/probable
uses for the code...
...and then deleted the files.
Sometimes life just sucks.