Uber interview question

Write a power function