Pls help me to debug my code

@Senjuti256 refer this

i have a doubt though my prblm is now solved.I observed that when I did not make a separate function to write the binary search code and wrote it inside main,my code did’nt pass last 2 test cases but as soon as i coded the binary search as a different function outside main function all test cases got passed.What is the reason for this?

@Senjuti256 because pow() can cause integer overflow so used it as a checker ( didn’t store it in a variable just checked)
you can also calculate power by keep multiplying and when power becomes greater than n return false

what is integer overflow?

@Senjuti256 when value becomes so much greater that it cant be stored in a variable