def isEvenlyDivisible(n: Int) = (1 until 20) forall (n % _ == 0)
Though, my program did take 12 seconds to run so I still think there are some optimizations that could be done to get it to run a little faster.
Actually, I just made a few enhancements and got it to finish in 7 seconds. I'd like to see if this can be done faster but for now, it's time to take on problem 6.
No comments:
Post a Comment