Coding challenge from r/dailyprogrammer