This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This problem was inspired by this original tweet by Max Howell: | |
// Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so fuck off. | |
// So, let's invert a binary tree in Javascript | |
// Original Tree | |
// 4 | |
// / \ | |
// 2 7 | |
// / \ / \ |