Metron, Inc. interview question

Write a factorial function