Please check why all the test cases are not running for boston number problem

Hello, I have made some changes in your code.
Accepted Code:


you were not checking if the number was of type (i^k)*c , for which i used a while condition instead of if.
And at the last if(n!=1) that means we are still left with a factor.
@Bhuwan-Agrawal-2362769150606526