a programming problem from programming-challenges.com