Question d’entretien chez AQR Capital Management

Write an algorithm to calculate x^n