Goldman Sachs interview question

How can you optimally implement a function to raise a number to an exponential?

Interview Answer

Anonymous

21 Jul 2021

Classic fast exponentiation with tail recursion and in O(log n)