Skip to content

Crazyconv/WhatLeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatLeetCode

hmm...

404: Wrong URL

String

  • ReMatching
  • WildcardMatching
  • StrStr: KMP
  • LongestPalindromicSubstring: Manacher's Algorithm
  • LongestSubstringWithoutRepeatingCharacters
  • LongestSubstringContaining2UniqueCharacters
  • SubstringwithConcatenationofAllWords
  • MinimumWindowSubstring
  • WordLadder
  • Atoi
  • GroupAnagrams
    • hash table
    • count sort
  • Remove Duplicate Letters
    • Greedy
    • Stack
  • ShortestPalindrome
  • InterleavingString
    • BFS
  • ReadNCharactersGivenRead4II
  • LargestNumber
    • sort
  • BasicCalculatorII

Array

  • MedianTwoArrays
  • KthLargestElement
    • several approaches
  • minSubArrayLen
  • LongestConsecutiveSequence
  • ContainsDuplicateIII
  • MergeKSortedArray
    • heap: PriorityQueue
  • MaximumGap
    • bucket sort
  • FirstMissingPositive
    • bucket sort
  • SortColors
    • Two pass using count sort
    • One pass using two pointers
  • ContainerWithMostWater
    • two pointers
    • stack
  • TrappingRainWater
    • dp: more than one attribute
    • two pointers
  • WiggleSort
  • WiggleSortII
    • find median using O(n) time and O(1) space
    • virtual indexing
  • CountofSmallerNumbersAfterSelf
  • CountOfRangeSum
    • divide and conquer
    • binary search tree
    • binary index tree
    • two pointer
  • CoinChange
    • DFS with prune
    • DP
  • BestMeetingPoint
    • bucket sort
    • two pointers
  • FindMedianFromDataStream
    • Binary Search Tree
    • Heap
  • NextPermutation
  • SearchInRotatedSortedArray
    • binary search
  • SearchInRotatedSortedArrayII
  • SearchForARange
  • Candy
    • two array
  • Majority ElementII
  • ReverseWordsInAStringII

LinkedList

  • ReorderList
    • find the middle element without using extra space
    • reverse list without using extra space
    • merge two lists without using extra space
  • SortList
    • merge sort linkedlist
  • InsertionSortList
    • insertion sort linkedlist
  • LinkedListCycle & LinkedListCycleII
    • detect a loop in a linked list
    • find the start of the loop in a linked list
  • RemoveDuplicatesfromSortedListII
    • use of "pointer"
  • LRUCache
  • ReverseLinkedList
    • iterative and recursive
  • RemoveNthNodeFromEndOfList
    • fast and slow pointer
  • PalindromeLinkedList
    • O(1) space
  • ArrayQueue
    • implement Queue using Array
  • MergeKSortedList
    • divide and conquer
  • MinStack

Matrix

  • SearchTwoDMatrixII
  • SurroundedRegions
    • Flood Fill
  • LargestRectangleInHistogram
    • JUST SOME TRICK
  • MaximalRectangle
  • WordSearchII
    • DFS + backtracking
    • Prefix Tree (remove redundant check)
  • Sudoku Solver

Tree & Heap

  • BinaryTreePreorderTraversal
    • pre-order (iterative)
  • BinaryTreeInorderTraversal
    • in-order (iterative)
  • BinaryTreePostorderTraversal
    • post-order (iterative)
  • BinaryTreeLevelOrderTraversal
    • use cur/pre
  • BinaryTreeVerticalOrderTraversal
  • ValidateBinarySearchTree
  • FlattenBinaryTreetoLinkedList
  • BinaryTreefromPreIn
  • SortedListtoBST
  • BinaryTreeMaximumPathSum
  • BSTIterator
  • UniqueBinarySearchTreesII
  • LowestCommonAncestorBT
  • MinimumHeightTrees
    • Tree property
  • SerializeAndDeserializeBinaryTree
  • RecoverBinarySearchTree
    • inorder BST is sorted
  • BinaryTreeZigzagLevelOrderTraversal
  • BinaryTreePaths
  • VerifyPreorderSequenceinBinarySearchTree
  • BSTFromPreorder
  • BinaryTreeUpsideDown
  • LargestBSTSubtree
  • VerifyPreorderSerializationofaBinaryTree
  • GraphValidTree
  • CountUnivalueSubtrees

Graph

  • CourseScheduleII
    • Topological sort

Bit Manipulation (mostly some optimization tricks)

  • SingleNumber
    • XOR
  • SingleNumberII
    • trick
  • SingleNumberIII
    • Two Pass
  • NumberOfOneBits
    • Trick
  • ReverseBits
    • Optimization
  • RepeatedDNASequences
    • Optimization
  • PowerOfTwo
  • GeneralizedAbbreviation
    • 2^n
  • GrayCode

Combinations and Permutations

  • Permutations
    • iterative (insertion)
    • recursive

Math

  • PowerOfThree
    • tricks
  • FactorialTrailingZeroes
  • CountPrimes
    • find primes up to n
  • DivideTwoIntegers
    • shift operator
  • MaxPointsLine
    • precision (zero)
  • IntegertoRoman
  • RomantoInteger
  • BulbSwitcher
    • magic
  • UglyNumberII
    • generation..
  • SuperUglyNumber
  • NimGame
  • PascalsTriangleII

Dynamic Programming

  • BestTimetoBuyandSellStockI
  • BestTimetoBuyandSellStockII
  • BestTimetoBuyandSellStockIII
  • BestTimetoBuyandSellStockIV
  • BestTimetoBuyandSellStockWithCooldown
  • JumpGame
  • JumpGameII
  • PalindromePartitioning
  • PalindromePartitioningII
  • WordBreak
  • WordBreakII
    • dp
    • jianzhi
  • BurstBalloons
    • reverse thinking
  • MinimumHeightTrees
  • ScrambleString

Binary Search

  • SmallestRectangleEnclosingBlackPixels

BFS/DFS

  • RemoveInvalidParentheses
  • AdditiveNumber

Segment Tree/Binary Index Tree

  • RangeSumQuery
  • RangeSumQuery2D

Releases

No releases published

Packages

No packages published

Languages