Like many others, I knocked this out in a few minutes, while I was eating lunch.

I then decided, like others, to try to do it different ways.  I came
up with 6 different solutions in about an hour, ranging from quite
straightforward to bizarre and cryptic.

I hope that those who are familiar with my musings, ponderings and
pontifications will realize that the latter ones were out of my
wheelhouse.

ISTR that this problem came up not too long ago in the code golfing
community.  I won't go that far!

---
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/