Next Number Greater Than A and B and Divisible by B

Published by werdna in

You are given two numbers a and b. Create a function that returns the next number greater than a and b and divisible by b.

Examples

divisibleByB(17, 8) ➞ 24

divisibleByB(98, 3) ➞ 99

divisibleByB(14, 11) ➞ 22

Notes

a will always be greater than b.

Watch a quick demo on how Edabit works.