Showing:
Handle Score
@Ibrahim Nash 6434
@mb1973 5708
@Quandray 5245
@akhayrutdinov 5111
@saiujwal13083 5046
@sanjay05 3762
@kirtidee18 3707
@mantu_singh 3556
@marius_valentin_dragoi 3523
@sushant_a 3459
Base Equivalence
Easy Accuracy: 41.85% Submissions: 137 Points: 2

Given a number (n) and no. of digits (m) to represent the number, find if given number can be represented in given no. of digits in any base from 2 to 32.

Example 1:

Input: n = 8, m = 2
Output: Yes
Explanation: Possible in base 3 as 8 in base 3 is 22.


Example 2:

Input: n = 8, m = 3
Output: No
Explanation: Not possible in any base.


You dont need to read input or print anything. Complete the function baseEquiv() which takes n and m as input parameter and returns "Yes" if its possible to represent the number else "No" without quotes..

Expected Time Complexity: O(logN).
Expected Auxiliary Space: O(1)

Constraints:
1 <= n <=109
1 <= m <=32