Workday interview question

Write a function to calculate x^y