Problem: Given a number in string in base b1, convert it to a base b2 number.
Solution 1:
2)Apply b2 to get the desired answer
Complexity: O(N + N*log_b2(b1)), where N is the length of the given N number in string.
This problem is popular in LeetCode and GeeksForGeeks. A collection of hundreds of interview questions and solutions are available in our blog at Interview Question
Solution
No comments:
Post a Comment