💡 Power(O(logn))

my code take O(n) complexity
https://ide.codingblocks.com/s/148013 here link my code
tell me how can i solve it o(logn) ?

just check this