Power(logn) problem

There is something wrong with my code and I am not being able to figure it out. Please help.

your approach is not correct

check out this

if you have any further doubts feel free to ask