Pregunta de entrevista de AQR Capital Management

Write an algorithm to calculate x^n