Problem solution for Week 5: binary tree traversal and least common ancestor finding