My LeetCode grinding. Trying to do a problem a day.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425
  1. Invert a binary tree.
  2. Example:
  3. Input:
  4. 4
  5. / \
  6. 2 7
  7. / \ / \
  8. 1 3 6 9
  9. Output:
  10. 4
  11. / \
  12. 7 2
  13. / \ / \
  14. 9 6 3 1
  15. Trivia:
  16. This problem was inspired by this original tweet by Max Howell:
  17. Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard so f*** off.