Oracle Interview Question

45 minute code challenge and your approach to the solution was more important than getting syntax perfect.