Solution to reddit challeng 139