Home > Reflections | โฎ๏ธ โญ๏ธ

2024-07-07 | ๐Ÿ’ผ Job ๐Ÿ” Search | ๐Ÿชž Symmetree ๐ŸŒฒ

๐Ÿง  Education

โณ๐Ÿ’ป๐Ÿ’ผ๐ŸŽฏ The 2-Hour Job Search: Using Technology to Get the Right Job Faster

๐Ÿ‹ Coding Practice

๐Ÿš€ Previously, I solved the ๐ŸŒณ LeetCode 101. Symmetric Tree.
๐Ÿคฆโ€โ™‚๏ธ On my first attempt, I actually failed to solve the problem, attempting an approach that didnโ€™t work out.
โฑ๏ธ Last time, I did implement a working solution, but it felt like more work than was necessary.
๐Ÿ“– Today, I looked up the official solution, and see that they demonstrate a recursive approach that I hadnโ€™t identified.
๐Ÿ’ก I find this approach interesting, because their isMirror function is nearly identical to the equal function I implemented as a helper in my working solution. ๐Ÿค” I struggled to find a recursive solution that directly solves the problem because I wasnโ€™t able to see how we could keep track of both sides of the tree independently as we recursively descend. ๐Ÿ‘€ I see that they solved this by creating an isMirror function that takes 2 trees, and descends each one recursively.