1. Two Sum

    Description:

    Solution:

    1. Using brute-force
    2. Using BST to find complement ⇒ O(nlogn)
  2. e

  3. Add 2 Nums (linked list)

    Description:

    You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

    You may assume the two numbers do not contain any leading zero, except the number 0 itself.

    Solution:

    1. Longest Substring Without Repeating Characters

    Description:

    Given a string s, find the length of the longest substring without duplicate characters.

    Solution:

  4. Longest Palindromic Substring (DP, 2 pointers) - not done

    Description:

    Given a string s, return the longest palindromic substring in s.

    Solution:

    1. Using 2 pointers
  5. e

  6. Reverse Integer

    Description:

    Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.

    Assume the environment does not allow you to store 64-bit integers (signed or unsigned).

    Solution:

    1. Using String to reverse (only if test case input is small)
    2. Using math
  7. e

  8. e

  9. e

  10. e

  11. e

  12. e

  13. e

  14. e

  15. e

  16. ee

  17. e

  18. e

  19. e