I gave my wife a programming puzzle for Valentine’s day. Can you solve it?