Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center).
🪞 Reflections
🎉 Success!
Previously, I’d tried to avoid reflection & equality checking because it seemed kinda wasteful and clunky. That was a mistake. Whatever seems most obviously correct should probably be the first choice to implement during an interview.
< 16 minutes is pretty good.
Manual testing is tedious sometimes, and annotating tree state for recursive functions is even more tedious and can be error prone.