Coupang Interview Question

Write a function that calculates exponents.