Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def smallestMultiple(left, right)
- x = left
- y = left
- divisible = false
- while(1)
- while (x <= right)
- if y % x == 0 then
- divisible = true
- else
- divisible = false
- break
- end
- x = x + 1
- end
- if divisible == true then
- return y
- end
- x = left
- y = y + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment