Code failing one of the test cases

My code is failing on of the test cases but I can’t find any mistake in it.

Your approach is not correct

your mistakes

  1. no need to calculate the no of digits in n

  2. 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

  3. Power function is not needed
    check modified code

Modified Correct Code