Given a decimal number N, the task is to check if a number has consecutive zeroes or not after converting the number to its K-based notation.
Input: N = 4, K = 2
4 in base 2 is 100, As there are consecutive 2 thus the answer is No.
Input: N = 15, K = 8
15 in base 8 is 17, As there are no consecutive 0 so the answer is Yes.
Approach: First convert the number N into base K and then simply check if the number has consecutive zeroes or not.
Below is the implementation of the above approach: