Reddit dailyprogrammer Challenge #143