Skip to content

MCEINS/LeetCode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yiran's leetcode

Bit Manipulation

Easy

  • 0136 Single Number
  • 0190 Reverse Bits
  • 0191 Number Of 1 Bits
  • 0231 Power Of Two
  • 0342 Power Of Four
  • 0371 Sum Of Two Integers
  • 0389 Find The Difference
  • 0401 Binary Watch
  • 0405 Convert a Number to Hexadecimal
  • 0461 Hamming Distance
  • 0645 Set Mismatch
  • 0693 Binary Number with Alternating Bits
  • 0762 Prime Number of Set Bits in Binary Representation
  • 0868 Binary Gap

Medium

  • 0137 Single Number II
  • 0187 Repeated DNA Sequences
  • 0201 Bitwise AND of Numbers Range
  • 0260 Single Number III
  • 0318 Maximum Product of Word Lengths
  • 0338 Counting Bits
  • 0421 Maximum XOR of Two Numbers in an Array

Array

Easy

  • 0001 Two Sum
  • 0026 Remove Duplicates from Sorted Array
  • 0027 Remove Element
  • 0035 Search Insert Position
  • 0053 Maximum Subarray
  • 0066 Plus One
  • 0088 Merge Sorted Array
  • 0118 Pascal's Triangle
  • 0119 Pascal's Triangle II
  • 0121 Best Time to Buy and Sell Stock
  • 0122 Best Time to Buy and Sell Stock II
  • 0167 Two Sum II - Input array is sorted
  • 0169 Majority Element
  • 0189 Rotate Array
  • 0217 Contains Duplicate
  • 0219 Contains Duplicate II
  • 0268 Missing Number
  • 0283 Move Zeroes
  • 0412 Fizz Buzz
  • 0414 Third Maximum Number
  • 0448 Find All Numbers Disappeared in an Array
  • 0485 Max Consecutive Ones
  • 0509 Fibonacci Number
  • 0532 K-diff Pairs in an Array
  • 0561 Array Partition I
  • 0566 Reshape the Matrix
  • 0581 Shortest Unsorted Continuous Subarray
  • 0605 Can Place Flowers
  • 0628 Maximum Product of Three Numbers
  • 0643 Maximum Average Subarray I
  • 0661 Image Smoother
  • 0665 Non-decreasing Array
  • 0674 Longest Continuous Increasing Subsequence
  • 0697 Degree of an Array
  • 0724 Find Pivot Index
  • 0746 Min Cost Climbing Stairs
  • 0766 Toeplitz Matrix
  • 0830 Positions of Large Groups
  • 0849 Maximize Distance to Closest Person
  • 0905 Sort Array By Parity
  • 0922 Sort Array By Parity II
  • 0977 Squares of a Sorted Array
  • 0989 Add to Array-Form of Integer
  • 1287 Element Appearing More Than 25% In Sorted Array
  • 1365 How Many Numbers Are Smaller Than the Current Number

Medium

  • 0011 Container With Most Water
  • 0015 3Sum
  • 0016 3Sum Closest
  • 0018 4Sum
  • 0031 Next Permutation
  • 0033 Search in Rotated Sorted Array
  • 0034 Find First and Last Position of Element in Sorted Array
  • 0039 Combination Sum
  • 0040 Combination Sum II
  • 0048 Rotate Image
  • 0054 Spiral Matrix
  • 0055 Jump Game
  • 0056 Merge Intervals
  • 0059 Spiral Matrix II
  • 0062 Unique Paths
  • 0063 Unique Paths II
  • 0064 Minimum Path Sum
  • 0073 Set Matrix Zeroes
  • 0074 Search a 2D Matrix
  • 0075 Sort Colors
  • 0078 Subsets
  • 0079 Word Search
  • 0080 Remove Duplicates from Sorted Array II
  • 0081 Search in Rotated Sorted Array II
  • 0090 Subsets II
  • 0105 Construct Binary Tree from Preorder and Inorder Traversal
  • 0106 Construct Binary Tree from Inorder and Postorder Traversal
  • 0120 Triangle
  • 0152 Maximum Product Subarray
  • 0153 Find Minimum in Rotated Sorted Array
  • 0209 Minimum Size Subarray Sum
  • 0216 Combination Sum III
  • 0228 Summary Ranges
  • 0229 Majority Element II
  • 0238 Product of Array Except Self
  • 0287 Find the Duplicate Number
  • 0442 Find All Duplicates in an Array
  • 1300 Sum of Mutated Array Closest to Target
  • 1337 The K Weakest Rows in a Matrix
  • 1338 Reduce Array Size to The Half
  • 1343 Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold
  • 1366 Rank Teams by Votes

Hash Table

Easy

  • 0202 Happy Number
  • 0204 Count Primes
  • 0205 Isomorphic Strings
  • 0242 Valid Anagram
  • 0290 Word Pattern
  • 0387 First Unique Character in a String
  • 0409 Longest Palindrome
  • 0438 Find All Anagrams in a String
  • 0463 Island Perimeter
  • 0594 Longest Harmonious Subsequence
  • 0599 Minimum Index Sum of Two Lists
  • 0705 Design HashSet
  • 0706 Design HashMap
  • 0771 Jewels and Stones
  • 0884 Uncommon Words from Two Sentences
  • 0953 Verifying an Alien Dictionary
  • 1002 Find Common Characters

Medium

  • 0003 Longest Substring Without Repeating Characters
  • 0036 Valid Sudoku
  • 0049 Group Anagrams
  • 0094 Binary Tree Inorder Traversal
  • 0138 Copy List with Random Pointer
  • 0347 Top K Frequent Elements
  • 0451 Sort Characters By Frequency
  • 0454 4Sum II
  • 0525 Contiguous Array
  • 0554 Brick Wall
  • 0560 Subarray Sum Equals K
  • 0648 Replace Words
  • 0692 Top K Frequent Words
  • 0718 Maximum Length of Repeated Subarray
  • 0739 Daily Temperatures
  • 0930 Binary Subarrays With Sum
  • 0954 Array of Doubled Pairs
  • 0974 Subarray Sums Divisible by K

String

Easy

  • 0013 Roman to Integer
  • 0014 Longest Common Prefix
  • 0020 Valid Parentheses
  • 0067 Add Binary
  • 0344 Reverse String
  • 0383 Ransom Note
  • 0415 Add Strings
  • 0434 Number of Segments in a String
  • 0443 String Compression
  • 0459 Repeated Substring Pattern
  • 0520 Detect Capital
  • 0557 Reverse Words in a String III
  • 0680 Valid Palindrome II
  • 0696 Count Binary Substrings
  • 0859 Buddy Strings
  • 0917 Reverse Only Letters
  • 0925 Long Pressed Name
  • 1309 Decrypt String from Alphabet to Integer Mapping

Medium

  • 0005 Longest Palindromic Substring
  • 0006 ZigZag Conversion
  • 0017 Letter Combinations of a Phone Number
  • 0022 Generate Parentheses
  • 0043 Multiply Strings
  • 0093 Restore IP Addresses
  • 0151 Reverse Words in a String
  • 0227 Basic Calculator II
  • 0539 Minimum Time Difference
  • 0583 Delete Operation for Two Strings
  • 0647 Palindromic Substrings
  • 0678 Valid Parenthesis String
  • 0767 Reorganize String
  • 0791 Custom Sort String
  • 0816 Ambiguous Coordinates
  • 0842 Split Array into Fibonacci Sequence
  • 0848 Shifting Letters
  • 0856 Score of Parentheses
  • 0890 Find and Replace Pattern
  • 0916 Word Subsets
  • 1347 Minimum Number of Steps to Make Two Strings Anagram
  • 1358 Number of Substrings Containing All Three Characters

Linked List

Easy

  • 0021 Merge Two Sorted Lists
  • 0083 Remove Duplicates from Sorted List
  • 0141 Linked List Cycle
  • 0160 Intersection of Two Linked Lists
  • 0203 Remove Linked List Elements
  • 0206 Reverse Linked List
  • 0234 Palindrome Linked List
  • 0237 Delete Node in a Linked List
  • 0707 Design Linked List
  • 0876 Middle of the Linked List

Medium

  • 0002 Add Two Numbers
  • 0019 Remove Nth Node From End of List
  • 0024 Swap Nodes in Pairs
  • 0061 Rotate List
  • 0082 Remove Duplicates from Sorted List II
  • 0086 Partition List
  • 0092 Reverse Linked List II
  • 0109 Convert Sorted List to Binary Search Tree
  • 0142 Linked List Cycle II
  • 0143 Reorder List
  • 0148 Sort List
  • 0445 Add Two Numbers II
  • 1367 Linked List in Binary Tree

Stack

Easy

  • 0155 Min Stack
  • 0225 Implement Stack using Queues
  • 0232 Implement Queue using Stacks
  • 0496 Next Greater Element I
  • 0844 Backspace String Compare

Medium

  • 0071 Simplify Path
  • 0103 Binary Tree Zigzag Level Order Traversal
  • 0144 Binary Tree Preorder Traversal
  • 0150 Evaluate Reverse Polish Notation
  • 0331 Verify Preorder Serialization of a Binary Tree
  • 0394 Decode String
  • 0402 Remove K Digits
  • 0456 132 Pattern
  • 0503 Next Greater Element II
  • 0735 Asteroid Collision
  • 0880 Decoded String at Index
  • 0907 Sum of Subarray Minimums
  • 0921 Minimum Add to Make Parentheses Valid
  • 0946 Validate Stack Sequences

Heap

Easy

  • 0703 Kth Largest Element in a Stream
  • 1046 Last Stone Weight

Medium

  • 0215 Kth Largest Element in an Array
  • 0264 Ugly Number II
  • 0313 Super Ugly Number
  • 0373 Find K Pairs with Smallest Sums
  • 0378 Kth Smallest Element in a Sorted Matrix
  • 0659 Split Array into Consecutive Subsequences

Tree

Easy

  • 0100 Same Tree
  • 0101 Symmetric Tree
  • 0104 Maximum Depth of Binary Tree
  • 0107 Binary Tree Level Order Traversal II
  • 0108 Convert Sorted Array to Binary Search Tree
  • 0110 Balanced Binary Tree
  • 0111 Minimum Depth of Binary Tree
  • 0112 Path Sum
  • 0226 Invert Binary Tree
  • 0235 Lowest Common Ancestor of a Binary Search Tree
  • 0257 Binary Tree Paths
  • 0404 Sum of Left Leaves
  • 0429 N-ary Tree Level Order Traversal
  • 0437 Path Sum III
  • 0501 Find Mode in Binary Search Tree
  • 0530 Minimum Absolute Difference in BST
  • 0538 Convert BST to Greater Tree
  • 0543 Diameter of Binary Tree
  • 0559 Maximum Depth of N-ary Tree
  • 0572 Subtree of Another Tree
  • 0589 N-ary Tree Preorder Traversal
  • 0590 N-ary Tree Postorder Traversal
  • 0617 Merge Two Binary Trees
  • 0637 Average of Levels in Binary Tree
  • 0653 Two Sum IV - Input is a BST
  • 0669 Trim a Binary Search Tree
  • 0687 Longest Univalue Path
  • 0700 Search in a Binary Search Tree
  • 0783 Minimum Distance Between BST Nodes
  • 0872 Leaf-Similar Trees
  • 0938 Range Sum of BST
  • 0965 Univalued Binary Tree
  • 0993 Cousins in Binary Tree

Medium

  • 0095 Unique Binary Search Trees II
  • 0096 Unique Binary Search Trees
  • 0098 Validate Binary Search Tree
  • 0102 Binary Tree Level Order Traversal
  • 0113 Path Sum II
  • 0114 Flatten Binary Tree to Linked List
  • 0116 Populating Next Right Pointers in Each Node
  • 0117 Populating Next Right Pointers in Each Node II
  • 0129 Sum Root to Leaf Numbers
  • 0199 Binary Tree Right Side View
  • 0230 Kth Smallest Element in a BST
  • 0236 Lowest Common Ancestor of a Binary Tree
  • 0654 Maximum Binary Tree

Binary Search

Easy

  • 0069 Sqrt(x)
  • 0278 First Bad Version
  • 0367 Valid Perfect Square
  • 0392 Is Subsequence
  • 0704 Binary Search

Medium

  • 0240 Search a 2D Matrix II

Sort

Easy

  • 0349 Intersection of Two Arrays
  • 0350 Intersection of Two Arrays II
  • 0976 Largest Perimeter Triangle

Medium

  • 0179 Largest Number

Math

Easy

  • 0168 Excel Sheet Column Title
  • 0171 Excel Sheet Column Number
  • 0172 Factorial Trailing Zeroes
  • 0263 Ugly Number
  • 0441 Arranging Coins

Medium

  • 0029 Divide Two Integers
  • 0050 Pow(x, n)
  • 0343 Integer Break
  • 1344 Angle Between Hands of a Clock
  • 1362 Closest Divisors
  • 1363 Largest Multiple of Three

Backtracking

Medium

  • 0046 Permutations
  • 0047 Permutations II
  • 0060 Permutation Sequence
  • 0077 Combinations
  • 0131 Palindrome Partitioning

Dynamic Programming

Easy

  • 0198 House Robber
  • 0221 Maximal Square

Medium

  • 0072 Edit Distance
  • 0091 Decode Ways
  • 0139 Word Break
  • 0279 Perfect Squares
  • 0309 Best Time to Buy and Sell Stock with Cooldown
  • 0322 Coin Change
  • 0375 Guess Number Higher or Lower II
  • 0494 Target Sum

Depth-First Search

Medium

  • 0200 Number of Islands
  • 1315 Sum of Nodes with Even-Valued Grandparent

Breadth-First Search

Medium

  • 0127 Word Ladder

Design

Medium

  • 1348 Tweet Counts Per Frequency
  • 1352 Product of the Last K Numbers
  • 1357 Apply Discount Every n Orders

Greedy

Medium

  • 1353 Maximum Number of Events That Can Be Attended
  • 1354 Construct Target Array With Multiple Sums

Trie

Medium

  • 0677 Map Sum Pairs

Recursion

Easy

  • 1137 N-th Tribonacci Number

About

yiran's leetcode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 52.3%
  • Go 47.7%