Skip to content

mahendrarathore1742/leetcode-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LanguageLicense

This project starts at 2017.12.26 and It will keep updating in the next year.

Algorithms

Bit Manipulation

Title Difficulty C++ Python Go Tag Note
Single Number
Single Number II
Single Number III
Power of Two
Power of Four
Missing Number
Number of 1 Bits
Reverse Bits
Majority Element
Sum of Two Integers
Find the Difference
Binary Watch
Convert a Number to Hexadecimal
Hamming Distance

Array

Title Difficulty C++ Python Go Tag Note

String

Title Difficulty C++ Python Go Tag Note
Simplify Path Medium split

Linked List

Title Difficulty C++ Python Go Tag Note
Middle of the Linked List Easy C++ two pointers
Remove Linked List Elements Easy C++
Remove Duplicates from Sorted List Easy C++
Remove Duplicates from Sorted List II Medium C++
Remove Nth Node From End of List Medium C++ two pointers
Merge Two Sorted Lists Easy Go
Merge k Sorted Lists Hard
Linked List Cycle Easy C++ two pointers
Linked List Cycle II Medium C++ two pointers
Intersection of Two Linked Lists Easy C++
Add Two Numbers Medium C++
Add Two Numbers II Medium C++ stack
Reverse Linked List Easy C++
Reverse Linked List II Medium C++
Reverse Nodes in k-Group Hard
Reorder List Medium Go
Sort List Medium Go sort Merge-Sort
Insertion Sort List Medium C++ sort
Palindrome Linked List Medium
Odd Even Linked List Medium
Swap Nodes in Pairs Medium
Copy List with Random Pointer Medium
Partition List Medium
Rotate List Medium

Stack

Title Difficulty C++ Python Go Tag Note
Valid Parentheses Easy C++
Longest Valid Parentheses Medium C++
Min Stack
Flatten Nested List Iterator
Mini Parser
Basic Calculator Hard C++
Basic Calculator II Medium C++
Basic Calculator III Hard C++
Evaluate Reverse Polish Notation Medium
Remove Duplicate Letters
Verify Preorder Serialization of a Binary Tree
Container With Most Water Medium C++
Trapping Rain Water Hard C++
Largest Rectangle in Histogram Hard C++
Maximal Rectangle Hard C++
Decode String
Remove K Digits
132 Pattern
Next Greater Element I
Next Greater Element II
Tag Validator
Exclusive Time of Functions
Baseball Game
Number of Atoms
Daily Temperatures
Backspace String Compare
Car Fleet
Score of Parentheses
Decoded String at Index
Maximum Frequency Stack
Online Stock Span
Sum of Subarray Minimums

Queue

Title Difficulty C++ Python Go Tag Note
Number of Recent Calls Easy
Design Circular Queue Medium
Design Circular Deque Medium
Task Scheduler Medium
Max Sum of Rectangle No Larger Than K Hard
Shortest Subarray with Sum at Least K Hard

Heap

Title Difficulty C++ Python Go Tag Note
Top K Frequent Elements
Top K Frequent Words
Kth Largest Element in an Array
Merge k Sorted Lists
Reorganize String
Cheapest Flights Within K Stops
Kth Largest Element in a Stream
Reorganize String
K-th Smallest Prime Fraction
Find K-th Smallest Pair Distance
Split Array into Consecutive Subsequences
Design Twitter
Super Ugly Number
Ugly Number II
Sort Characters By Frequency

Tree

Title Difficulty C++ Python Go Tag Note
Same Tree Easy C++
Symmetric Tree Easy C++
Balanced Binary Tree Easy C++
Minimum Depth of Binary Tree Easy C++
Maximum Depth of Binary Tree Easy C++
Binary Tree Preorder Traversal Easy C++
Binary Tree Inorder Traversal Easy C++
Binary Tree Postorder Traversal Easy C++
Binary Tree Level Order Traversal Medium C++ queue
Binary Tree Level Order Traversal II Easy C++ queue
Binary Tree Zigzag Level Order Traversal Medium C++ queue
Construct Binary Tree from Preorder and Inorder Traversal Medium C++
Construct Binary Tree from Inorder and Postorder Traversal Medium C++
Construct Binary Tree from Preorder and Postorder Traversal Medium C++
Path Sum Easy C++
Path Sum II Medium C++ backtracking
Path Sum III Easy C++
Sum of Left Leaves
Insert into a Binary Search Tree Medium C++
Search in a Binary Search Tree Easy C++
Lowest Common Ancestor of a Binary Search Tree Easy C++
Binary Search Tree Iterator
Validate Binary Search Tree
Serialize and Deserialize BST
Delete Node in a BST
Trim a Binary Search Tree
Convert Sorted Array to Binary Search Tree
Find Mode in Binary Search Tree
Most Frequent Subtree Sum
Find Bottom Left Tree Value
Find Largest Value in Each Tree Row
Diameter of Binary Tree
Convert BST to Greater Tree
Binary Tree Tilt
Subtree of Another Tree
Merge Two Binary Trees
Average of Levels in Binary Tree
Add One Row to Tree
Find Duplicate Subtrees
Two Sum IV - Input is a BST
Maximum Binary Tree
Print Binary Tree
Maximum Width of Binary Tree
Trim a Binary Search Tree
Second Minimum Node In a Binary Tree
Redundant Connection
Redundant Connection II
Longest Univalue Path
Binary Tree Pruning
Sum of Distances in Tree
All Nodes Distance K in Binary Tree
Smallest Subtree with all the Deepest Nodes
N-ary Tree Postorder Traversal
N-ary Tree Preorder Traversal
N-ary Tree Level Order Traversal
Maximum Depth of N-ary Tree
Leaf-Similar Trees
All Possible Full Binary Trees
Increasing Order Search Tree

Graph

Title Difficulty C++ Python Go Tag Note
Clone Graph
Evaluate Division
Network Delay Time
Redundant Connection
Redundant Connection II
Minimum Height Trees
Reconstruct Itinerary

Hash Table

Title Difficulty C++ Python Go Tag Note

Math

Title Difficulty C++ Python Go Tag Note

Sort

Title Difficulty C++ Python Go Tag Note
Valid Anagram
H-Index
Sort Colors
Intersection of Two Arrays
Intersection of Two Arrays II
Sort List
Insertion Sort List
Largest Number
Merge Intervals
Reorganize String
Longest Word in Dictionary through Deleting
Maximum Gap
Insert Interval
Implement Trie (Prefix Tree) Medium C++ Go Trie

Two Pointers

Title Difficulty C++ Python Go Tag Note

Binary Search

Title Difficulty C++ Python Go Tag Note
First Bad Version
Pow(x, n)
Sqrt(x)
Heaters
Search for a Range

Binary Search Tree

Title Difficulty C++ Python Go Tag Note
Range Sum Query - Mutable
Count of Smaller Numbers After Self
The Skyline Problem
Reverse Pairs

Breadth-First Search

Title Difficulty C++ Python Go Tag Note
Binary Tree Level Order Traversal
Binary Tree Level Order Traversal II
Binary Tree Zigzag Level Order Traversal
Binary Tree Right Side View
Perfect Squares
Surrounded Regions
Minimum Height Trees
Course Schedule
Clone Graph

Depth-First Search

Title Difficulty C++ Python Go Tag Note
Path Sum
Path Sum II
Binary Tree Right Side View
Same Tree
Construct Binary Tree from Preorder and Inorder Traversal
Construct Binary Tree from Inorder and Postorder Traversal
Balanced Binary Tree
Minimum Depth of Binary Tree
Flatten Binary Tree to Linked List
Sum Root to Leaf Numbers
Binary Tree Maximum Path Sum
Number of Islands
Remove Invalid Parentheses
Longest Increasing Path in a Matrix

Recursion

Title Difficulty C++ Python Go Tag Note
Longest Univalue Path Easy
放平果 Medium C++ 分类讨论
Hanoi Medium C++
Partition to K Equal Sum Subsets Medium
K-th Symbol in Grammar Medium
Valid Tic-Tac-Toe State Medium
All Possible Full Binary Trees Medium
Number of Atoms Hard
Special Binary String Hard

Backtracking

Title Difficulty C++ Python Go Tag Note
Red and Black Medium C++
Combination Sum Medium C++
Combination Sum II Medium C++
Combination Sum III Medium C++
Permutations Medium C++
Permutations II Medium C++
Subsets Medium C++
Subsets II Medium C++
N-Queens Hard C++
N-Queens II Hard C++
Sudoku Solver Hard
Word Search Medium
Word Search II Hard
Restore IP Addresses Medium
Palindrome Partitioning Medium C++
Wildcard Matching Hard
Regular Expression Matching Hard
Word Ladder Medium
Word Ladder II Hard
Additive Number Medium
Binary Watch Easy
Count Numbers with Unique Digits Medium
Beautiful Arrangement Medium
Letter Case Permutation Easy

Dynamic Programming

Title Difficulty C++ Python Go Tag Note
Climbing Stairs Easy C++ Python
Min Cost Climbing Stairs Easy C++
Edit Distance Hard C++
Longest Increasing Subsequence Medium C++
Maximum Length of Repeated Subarray Medium C++
Minimum Path Sum Medium C++
Unique Paths Medium C++
Unique Paths II Medium C++
Unique Binary Search Trees Medium C++
Unique Binary Search Trees II Medium C++
Triangle Medium C++
Charm Bracelet Medium C++ 0/1背包问题
Coin Change Medium C++ 完全背包问题
Coin Change 2 Medium C++ 完全背包问题
Perfect Squares Medium C++ 0/1背包问题
Ones and Zeroes Medium C++ 二维0/1背包问题
Maximal Square Medium C++
Maximal Rectangle Hard
Can I Win Medium C++
Target Sum
Word Break Medium C++
Predict the Winner
Longest Palindromic Subsequence Medium C++
Longest Palindromic Substring Medium C++
Count Different Palindromic Subsequences
Cheapest Flights Within K Stops
Minimum ASCII Delete Sum for Two Strings
Partition to K Equal Sum Subsets
Knight Probability in Chessboard
Delete and Earn
Arithmetic Slices
Arithmetic Slices II - Subsequence
Decode Ways
Decode Ways II
Shopping Offers

Greedy

Title Difficulty C++ Python Go Tag Note
Container With Most Water Medium C++
Jump Game Medium
Jump Game II Hard
Gas Station Medium
Candy Hard
Remove Duplicate Letters Hard
Create Maximum Number Hard
Patching Array Hard
Queue Reconstruction by Height Medium
Remove K Digits Medium
Non-overlapping Intervals Medium
Minimum Number of Arrows to Burst Balloons Medium
Assign Cookies Easy
IPO Hard
Dota2 Senate Medium
Split Array into Consecutive Subsequences Medium
Monotone Increasing Digits Medium
Partition Labels Medium
Reorganize String Medium
Lemonade Change Easy
Delete Columns to Make Sorted Medium
Boats to Save People Medium
Walking Robot Simulation Medium
Advantage Shuffle Medium
Score After Flipping Matrix Medium

Union Find

Title Difficulty C++ Python Go Tag Note
Surrounded Regions Medium
Number of Islands Medium
Longest Consecutive Sequence Hard
Accounts Merge Medium
Friend Circles Medium
Redundant Connection Medium
Redundant Connection II Hard
Couples Holding Hands Hard
Swim in Rising Water Hard
Bricks Falling When Hit Hard
Similar String Groups Hard
Minimize Malware Spread II Hard

Geometry

Title Difficulty C++ Python Go Tag Note
Erect the Fence Hard C++ Python Monotone Chain

Design

Title Difficulty C++ Python Go Tag Note
LRU Cache Hard C++ Python

SQL

Shell

About

repo for leetcode.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published