think-cell Interview Question

Programming tasks via codepad, no stl is needed or allowed.