Coupang interview question

Write a function that calculates exponents.