Apple Interview Question

mathematical riddles, stacks, linked list