


Can you solve this in logarithmic time and space complexity?
The first line of input contains a single integer 'T', representing the number of test cases.
The first line of each test contains a single integer 'N', denoting the URL id.
For each test case, return a short URL for the URL id.
You don't need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 1000
0 <= N <= 10^18
Time limit: 1sec
The idea here is to use recursion and generate a short URL. We will start from the last digit of ‘N’ and add its corresponding modulo 62 code to answer the string and then divide ‘N’ by 62. Finally, we reverse the answer string to get a short URL.
The Steps are as follows:
void shortUrlRecursion(‘ANSWER’, ‘N’):
The idea here is similar to finding a binary representation of a number. We keep dividing ‘N’ with 62 and its corresponding code to answer until it becomes < 62. Then finally add ‘CODE[N]’ to answer and reverse our answer.
The Steps are as follows:
Sorted Doubly Linked List to Balanced BST
Longest Substring with K-Repeating Characters
Expression Add Operators
Gray Code Transformation
Count of Subsequences with Given Sum