Reddit DailyProgrammer Challenge #140 [Intermediate]