The key to solving it is finding a solution that works for any number of face-down cards. It also mentions: "It should handle 99 through 9999 cards, etc. Empty piles are fine, they have 0 face up." ...