My code is failing on of the test cases but I can’t find any mistake in it.
Code failing one of the test cases
Your approach is not correct
your mistakes
-
no need to calculate the no of digits in n
-
ans may contain different no of digits
for ex input 35631 contains 5 digits but octal no corresponding to this is 105457 contains 6 digits -
Power function is not needed
check modified code
Modified Correct Code