Nest Interview Question

Easy question to implement an existing language function from scratch