/Leetcode

JAVA Solutions for Leetcode

Primary LanguageJava

JAVA Solutions for Leetcode

Remember solutions are only solutions to given problems. If you want full study checklist for code & whiteboard interview, please turn to Aditya Verma videos.

Also, there are open source implementations for basic data structs and algorithms, such as Algorithms in Python and Algorithms in Java.

I will upload 3-4 leetcode solution daily, and i will go in series

Problems & Solutions

# Title Basic idea (One line) Time Complexity
1 Two Sum 1. Use HashMap and find remaining item.
2. Sort and search with two points
O(n)
2 Add Two Numbers Take care of the carry from lower digit. O(n)
3 Longest Substring Without Repeating Characters 1. Check every possible substring O(n^2)
2. Use two pointer aproach and store the elements in Hash/Set to check repeat. O
O(n)
4 Median of Two Sorted Arrays 1. Merge two sorted lists and compute median.
2. An extension of median of two sorted arrays of equal size problem
O(m+n)