Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def applesDistribution(apples, boxCapacity, maxResidue)
- x = 1
- number = 0
- while (x <= boxCapacity)
- if apples % x == 0 or (apples - maxResidue) % x == 0 then
- number = number + 1
- end
- x = x + 1
- end
- return number
- end
Advertisement
Add Comment
Please, Sign In to add comment