How would you optimally calculate p^k, where k is a non-negative integer? What is the complexity of the solution?

Posted on by