Meta Interview Question

write some code, analyze the worst case complexity