Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // prob 5
- def multiple(a: Int, end:Int): Boolean = (1 to end).forall{n => a % n == 0}
- assert(2520 == Iterator.from(1).dropWhile(x => !multiple(x, 10)).next)
- Iterator.from(1).dropWhile(!multiple(_, 20)).next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement