Code Monkey home page Code Monkey logo

leetcode's Introduction

LeetCode solutions in Java

Linear List

Array

Remove Duplicates from Sorted Array

  • Remove Duplicates from Sorted Array II
  • Longest Consecutive Sequence
  • Two Sum
  • 3Sum
  • 3Sum Closest
  • 4Sum
  • Remove Element
  • Move Zeroes
  • Next Permutation
  • Permutation Sequence
  • Valid Sudoku
  • Trapping Rain Water
  • Rotate Image
  • Plus One
  • Climbing Stairs
  • Set Matrix Zeroes
  • Gas Station
  • Candy
  • Majority Element
  • Rotate Array
  • Contains Duplicate
  • Contains Duplicate II
  • Contains Duplicate III
  • Product of Array Except Self
  • Game of Life
  • Increasing Triplet Subsequence

Linked List

  • Reverse Linked List
  • Odd Even Linked List
  • Add Two Numbers
  • Reverse Linked List II
  • Partition List
  • Remove Duplicates from Sorted List
  • Remove Duplicates from Sorted List II
  • Rotate List
  • Remove Nth Node From End of List
  • Swap Nodes in Pairs
  • Reverse Nodes in k-Group
  • Copy List with Random Pointer
  • Linked List Cycle
  • Linked List Cycle II
  • Reorder List
  • LRU Cache
  • Palindrome Linked List

String

  • Valid Palindrome
  • Implement strStr()
  • String to Integer (atoi)
  • Add Binary
  • Longest Palindromic Substring
  • Regular Expression Matching
  • Wildcard Matching
  • Longest Common Prefix
  • Valid Number
  • Integer to Roman
  • Roman to Integer
  • Count and Say
  • Anagrams
  • Valid Anagram
  • Simplify Path
  • Length of Last Word
  • Isomorphic Strings
  • Word Pattern

Stack && Queue

Stack

  • Min Stack
  • Valid Parentheses
  • Longest Valid Parentheses
  • Largest Rectangle in Histogram
  • Evaluate Reverse Polish Notation
  • Implement Stack using Queues

Queue

  • Implement Queue using Stacks

Binary Tree

Traverse

  • Binary Tree Preorder Traversal
  • Binary Tree Inorder Traversal
  • Binary Tree Postorder Traversal
  • Binary Tree Level Order Traversal
  • Binary Tree Level Order Traversal II
  • Binary Tree Right Side View
  • Invert Binary Tree
  • Binary Search Tree Iterator
  • Binary Tree Zigzag Level Order Traversal
  • Recover Binary Search Tree
  • Same Tree
  • Symmetric Tree
  • Balanced Binary Tree
  • Flatten Binary Tree to Linked List
  • Populating Next Right Pointers in Each Node II

Construct

  • Construct Binary Tree from Preorder and Inorder Traversal
  • Construct Binary Tree from Inorder and Postorder Traversal

Binary Search Tree

  • Unique Binary Search Trees
  • Unique Binary Search Trees II
  • Validate Binary Search Tree
  • Convert Sorted Array to Binary Search Tree
  • Convert Sorted List to Binary Search Tree
  • LCA of BST
  • Kth Smallest Element in a BST

Recursion

  • Minimum Depth of Binary Tree
  • Maximum Depth of Binary Tree
  • Path Sum
  • Path Sum II
  • Binary Tree Maximum Path Sum
  • Populating Next Right Pointers in Each Node
  • Sum Root to Leaf Numbers
  • LCA of Binary Tree

Segment Tree

  • Range Sum Query - Mutable

Sort

Insertion Sort

  • Insertion Sort List

Merge Sort

  • Merge Two Sorted Arrays
  • Merge Two Sorted Lists
  • Merge k Sorted Lists
  • Sort List

Quick Sort

  • Sort Colors
  • Kth Largest Element in an Array

Bucket Sort

  • First Missing Positive

Counting Sort

  • H-Index

Radix Sort

  • Maximum Gap

Else

  • Largest Number

Search

  • Search for a Range
  • Search Insert Position
  • Search in Rotated Sorted Array
  • Search in Rotated Sorted Array II
  • Search a 2D Matrix
  • Search a 2D Matrix II
  • Find Minimum in Rotated Sorted Array
  • Find Minimum in Rotated Sorted Array II
  • Median of Two Sorted Arrays
  • H-Index II

Exhaustive Attack

  • Subsets
  • Subsets II
  • Permutations
  • Permutations II
  • Combinations
  • Letter Combinations of a Phone Number

Breadth First Search

  • Word Ladder
  • Word Ladder II
  • Surrounded Regions

Depth First Search

  • Additive Number
  • Palindrome Partitioning
  • Unique Paths
  • Unique Paths II
  • N-Queens
  • N-Queens II
  • Restore IP Addresses
  • Combination Sum
  • Combination Sum II
  • Combination Sum III
  • Generate Parentheses
  • Sudoku Solver
  • Word Search

Divide and Conquer

  • Pow(x,n)
  • Sqrt(x)

Greedy

  • Jump Game
  • Jump Game II
  • Best Time to Buy and Sell Stock
  • Best Time to Buy and Sell Stock II
  • Longest Substring Without Repeating Characters
  • Container With Most Water
  • Patching Array

Dynamic Programming

  • Triangle
  • Maximum Subarray
  • Maximum Product Subarray
  • Longest Increasing Subsequence
  • Palindrome Partitioning II
  • Maximal Rectangle
  • Best Time to Buy and Sell Stock III
  • Best Time to Buy and Sell Stock IV
  • Best Time to Buy and Sell Stock with Cooldown
  • Interleaving String
  • Scramble String
  • Minimum Path Sum
  • Edit Distance
  • Decode Ways
  • Distinct Subsequences
  • Word Break
  • Word Break II
  • Dungeon Game
  • House Robber
  • House Robber II
  • House Robber III
  • Range Sum Query - Immutable
  • Range Sum Query 2D - Immutable

Graph

  • Clone Graph

Bit Manipulation

  • Reverse Bits
  • Repeated DNA Sequences
  • Number of 1 Bits
  • Gray Code
  • Single Number
  • Single Number II
  • Single Number III
  • Power of Two
  • Missing Number
  • Maximum Product of Word Lengths
  • Bitwise AND of Numbers Range
  • Power of Three
  • Rectangle Area

Math

  • Happy Number
  • Ugly Number
  • Ugly Number II
  • Super Ugly Number
  • Fraction to Recurring Decimal
  • Factorial Trailing Zeroes
  • Nim Game

Simulation

  • Reverse Integer
  • Palindrome Number
  • Insert Interval
  • Merge Intervals
  • Minimum Window Substring
  • Multiply Strings
  • Substring with Concatenation of All Words
  • Pascal's Triangle
  • Pascal's Triangle II
  • Spiral Matrix
  • Spiral Matrix II
  • ZigZag Conversion
  • Divide Two Integers
  • Text Justification
  • Max Points on a Line

leetcode's People

Contributors

jasonren23 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.