Progamming challenge from /r/dailyprogrammer.