Kth boom number
Easy Accuracy: 48.58% Submissions: 103 Points: 2

Boom numbers are numbers consisting only of digits 2 and 3. Given an integer K, display the K-th Boom number.

Example 1:

Input:
K = 5
Output: 32
Explanation:
The Boom series is 2, 3, 22, 23, 32, 33, 222....
and, for K=5, answer = 32

 

Example 2:

Input:
K = 100
Output: 322323

Your Task:  
You don't need to read input or print anything. Your task is to complete the function BoomNumber() which takes an interger K as input parameter and returns the Kth boom number in the form of a string.

 

Expected Time Complexity: O( log(K) )
Expected Auxiliary Space: O( log(K) )



Constraints:
1 ≤ K ≤ 1012

We are replacing the old Disqus forum with the new Discussions section given below.
Click here to view old Disqus comments.


to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Kth boom number

Output Window