LinkedIn interview question

Implement pow function.