A few months ago, some coworkers sent around a Ruby challenge. It appears simple, but we can sometimes learn a lot from simple problems.
Write a Ruby program that determines the smallest three digit number such that when said number is divided by the sum of its digits the answer is 20.
In case that's not clear, let's pick a number, say, 123. The sum of the digits of 123 is 6, and 123/6 = 20.5, so 123 is not a solution. What is?
Here's some Ruby code I wrote to solve it:
def digitSum(num,...