Leetcode solutions

The following are my solutions to various leetcode problems, listed chronologically starting with the most recently solved.  You can find a link to my profile here.


  1. Sum Root to Leaf Numbers
    → binary tree dfs

    June 21, 2023

  2. Path Sum
    → binary tree dfs

    June 21, 2023

  3. Invert Binary Tree
    → binary tree dfs

    June 20, 2023

  4. Same Tree
    → Binary tree dfs

    June 20, 2023

  5. Maximum Depth of Binary Tree
    → binary tree dfs

    June 20, 2023

  6. Min Stack
    → stacks

    June 12, 2023

  7. Two Sum II - Input Array Is Sorted
    → two pointers

    June 12, 2023

  8. Longest Consecutive Sequence
    → hashmap

    June 12, 2023

  9. Contains Duplicate II
    → hashmap

    June 12, 2023

  10. Set Matrix Zeroes
    → matrix

    June 12, 2023

  11. Rotate Image
    → matrix

    June 12, 2023

  12. Spiral Matrix
    → matrix

    June 12, 2023

  13. Valid Sudoku
    → Matrix

    June 12, 2023

  14. Partition List
    → Linked List

    June 12, 2023

  15. Rotate List
    → Linked List

    June 12, 2023

  16. Remove Duplicates from Sorted List II
    → Linked List

    June 11, 2023

  17. Remove Nth Node From End of List
    → Linked List

    June 11, 2023

  18. Pow(x, n)
    → Math

    June 11, 2023

  19. Factorial Trailing Zeroes
    → math

    June 11, 2023

  20. Sqrt(x)
    → Math

    June 11, 2023

  21. Plus One
    → Math

    June 11, 2023

  22. Group Anagrams
  23. → Hashmap

    June 10, 2023

  24. Reverse Linked List II
    → Linked List

    June 10, 2023

  25. Copy List with Random Pointer
  26. → Linked List

    June 10, 2023

  27. Evaluate Reverse Polish Notation
  28. → stack

    June 9, 2023