Skip to content

This project aims to provide solutions to LeetCode coding problems using both JavaScript and Python3 programming languages. One DSA challenge a day keeps the bugs away.

Notifications You must be signed in to change notification settings

JohnKamaujk/LeetCodeLab

Repository files navigation

LeetCode

Leetcode 解决方案

Solutions

Press Control+F(or Command+F on the Mac) to search anything you want.

# Solution Tags Difficulty Remark
0001 Two Sum Array,Hash Table Easy
0002 Add Two Numbers Recursion,Linked List,Math Medium
0003 Longest Substring Without Repeating Characters Hash Table,String,Sliding Window Medium
0004 Median of Two Sorted Arrays Array,Binary Search,Divide and Conquer Hard
0005 Longest Palindromic Substring String,Two Pointers,Dynamic Programming Medium
0006 Zigzag Conversion String Medium
0007 Reverse Integer Math Medium
0008 String to Integer (atoi) String Medium
0009 Palindrome Number Math Easy
0010 Regular Expression Matching Recursion,String,Dynamic Programming Hard
0011 Container With Most Water Greedy,Array,Two Pointers Medium
0012 Integer to Roman Hash Table,Math,String Medium
0013 Roman to Integer Hash Table,Math,String Easy
0014 Longest Common Prefix Trie,String Easy
0015 3Sum Array,Two Pointers,Sorting Medium
0016 3Sum Closest Array,Two Pointers,Sorting Medium
0017 Letter Combinations of a Phone Number Hash Table,String,Backtracking Medium
0018 4Sum Array,Two Pointers,Sorting Medium
0019 Remove Nth Node From End of List Linked List,Two Pointers Medium
0020 Valid Parentheses Stack,String Easy
0021 Merge Two Sorted Lists Recursion,Linked List Easy
0022 Generate Parentheses String,Dynamic Programming,Backtracking Medium
0023 Merge k Sorted Lists Linked List,Divide and Conquer,Heap (Priority Queue),Merge Sort Hard
0024 Swap Nodes in Pairs Recursion,Linked List Medium
0025 Reverse Nodes in k-Group Recursion,Linked List Hard
0026 Remove Duplicates from Sorted Array Array,Two Pointers Easy
0027 Remove ELement from an Array Array,Two Pointers Easy
0028 Remove ELement from an Array Array,Two Pointers Easy
0029 Divide Two Integers Math,Bit Manipulation Medium
0035 Search Insert Position Array,Binary Search Easy
0038 Count And Say String Medium
0039 Combination Sum Array,Backtracking Medium
0046 Permutations Array,Backtracking Medium
0050 Pow(x, n) Math,Recursion Medium
0058 Length Of Last Word String Easy
0062 Unique Paths Math, Dynamic Programming, Combinatorics Medium
0023 Merge k Sorted Lists Linked List,Divide and Conquer,Heap (Priority Queue),Merge Sort Hard
0024 Swap Nodes in Pairs Recursion,Linked List Medium
0025 Reverse Nodes in k-Group Recursion,Linked List Hard
0023 Merge k Sorted Lists Linked List,Divide and Conquer,Heap (Priority Queue) Hard
0025 Reverse Nodes in k-Group Recursion,Linked List Hard
0031 Next Permutation Array,Two Pointers Medium
0034 Find First and Last Position of Element in Sorted Array Array,Binary Search Medium
0036 Valid Sudoku Array,Hash Table,Matrix Medium
0040 Combination Sum II Array,Backtracking Medium
0041 Smallest Positive NUmber Array,Hash Table Hard
0042 Trapping Rain Water Array,Two Pointers,Dynamic Programming, Stack, Monotonic Stack Hard
0049 Group Anagrams Array,Hash Table,String, Sorting Medium
0064 Minimum Sum Path Array,Dynamic Programming,Matrix Medium
0065 Valid Number String Hard
0067 Add Binary Math,Binary Search Easy
0069 Sqrt(x) Math, Sring, Bit Manipulation, Simulation Easy
0075 Sort Colors Array, Two Pointers, Sorting Medium
0077 Combinations BackTracking Medium
0078 Subsets Array,Backtracking,Bit Manipulation Medium
0083 Remove Duplicates from Sorted List Linked List Easy
0087 Scramble String String, Dynamic Programming Easy
0088 Merge Sorted Arrays Array, Two Pointers, Sorting Easy
0093 Restore IP Addresses String, Backtracking Medium
0094 Binary Tree Inorder Traversal Stack, Tree, Depth-First Search, Binary Tree Easy
0096 Unique Binary Search Trees Math, Dynamic Programming, Tree, Binary Search Tree, Binary Tree Medium
0097 Interleaving String String, Dynamic Programming Medium
0100 Same Tree Tree, Depth-First Search, Breadth-First Search, Binary Tree Easy
0108 Convert Sorted Array To Binary Search Tree Array,Divide and Conquer, Tree, ``Binary Search Tree, Binary Tree` Easy
0112 Path Sum Breadth-First Search,Depth-First Search, Tree, ``Binary Search Tree, Binary Tree` Easy
0118 Pascal Traingle Array, Dynamic Programming Easy
0119 Pascal Triangle II Array, Dynamic Programming Easy
0136 Single Number Array, Bit Manipulation Easy
0151 Reverse Words in a String Two Pointers, Strings Medium
0160 Intersection of Two Linked Lists Two Pointers, Hash Table, Linked List Easy
0169 Majority Element Array, Hash Table, Sorting, Divide and Conquer, Counting Easy
0175 Combine Two Tables Database Easy
0181 Employees Earning More Than Their Managers Database Easy
0182 Duplicate Emails Database Easy
0183 Customers Who Never Order Database Easy
0184 Duplicate Emails Database Easy
0185 Customers Who Never Order Database Easy
0190 Reverse Bits Bit Manipulation, Divide and Conquer Easy
0191 Number Of 1 Bits Bit Manipulation, Divide and Conquer Easy
0192 Word Frequency Shell Easy
0193 Valid Phone Numbers Shell Easy
0197 Rising Temperature Database Easy
0200 Number of Islands Array, Depth-First Search, Breadth-First Search, Matrix Medium
0205 Isomorphic Strings Hash Table, String Easy
0206 Reverse Linked List Linked List, Recursion Easy
0219 Contains Duplicate II Array, Hash Table, Sliding Window Easy
0222 Count Complete Tree Nodes Tree, Binary Search, Bit Manipulation, Binary Tree Easy
0226 Invert Binary Tree Tree, Breadth-First Search, Depth-First Search, Binary Tree Easy
0228 Summary Ranges Array Easy
0231 Power of Two Math, Recursion, Bit Manipulation Easy
0234 Palindrome Linked List Linked List, Recursion, Two Pointers, Stack Easy
0257 Binary Tree Paths String,Tree, Backtracking, Depth-First Search, Binary Tree Easy
0258 Add Digits Math, Simulation, Number Theory Easy
0263 Ugly Number Math Easy
0278 First Bad Version Binary Search, Interactive Easy
0279 Perfect Squares Math, Dynamic Programming,Breadth-First Search Medium
0292 Nim Game Math, Brainteaser,Game Theory Easy
0303 Range Sum Query - Immutable Array, Design,Prefix Sum Easy
0326 Power Of Three Math, Recursion Easy
0338 Counting Bits Dynamic Programming, Bit Manipulation Easy
0342 Power Of Four Math, Recursion, Bit Manipulation Easy
0345 Reverse Vowels Of A String String, Two Pointers Easy
0349 Intersection of Two Array Array, Hash Table, Two Pointers, Binary Search, Sorting Easy
0350 Intersection of Two Array II Array, Hash Table, Two Pointers, Binary Search, Sorting Easy
0367 Valid Perfect Square Math, Binary Search Easy
0374 Guess Number Higher or Lower Binary Search, Interactive Easy
0383 Ransom Note Hash Table, String, Counting Easy
0386 Lexical Order Depth First Search, Tier Medium
0389 Find the Difference Hash Table, String, Bit Manipulation, Sorting Easy
0392 Is Subsequence Two Pointers, String, Dynamic Programming Easy
0394 Decode String String, Stack, Recursion Medium
0404 Sum Of Left Leaves Tree, Depth First Search, Breadth First Search, Binary Tree Easy
0405 Convert a Number to a Hexadecimal Math, Bit Manipulation Easy
0409 Longest Palindrome Hash Table, String, Greedy Easy
0414 Third Max Number Array, Sorting Easy
0415 Add Strings Math, String, Simulation Easy
0440 K-th Smallest in Lexicographical Order Trie Hard
0463 Island Perimeter Array, Depth-First Search, Breadth-First Search, Matrix Easy
0476 Number Complement Bit Manipulation Easy
0485 Max Consecutive Ones Array Easy
0492 Construct The Rectangle Math Easy
0500 Keyboard Row Array, Hash Table, String Easy
0504 Base 7 Math Easy
0506 Relative Ranks Array, Sorting, Heap(Priority Queue) Easy
0507 Perfect Number Math Easy
0509 Fibonacci Number Array, Dynamic Programming, Breadth-First Search, Matrix Easy
0511 Game Play Analysis I Database Easy
0520 Detect Capital String, Easy
0521 Longest Uncommon Subsequence I String, Easy
0541 Reverse String II String, Two Pointers Easy
0553 Optimal Division Array, Math, Dynamic Programming Easy
0557 Reverse Words in a String III String, Two Pointers Easy
0561 Array Partition Array, Greedy, Sorting, Counting Sorting Easy
0594 Longest Harmonious Subsequence Array, Hash Table, Sliding Window, Sorting, Counting Easy
0704 Binary Search Array, Binary Search Easy
0709 To Lower Case String Easy
0728 Self Dividing Numbers Math Easy
0821 Shortest Distance to a Character Two Pointers,String,Array Easy
0838 Push Dominoes Two Pointers,String,Dynamic Programming Easy
0844 Back String Compare Two Pointers,String,Stack, Simulation Easy
0905 Sort Array By Parity Array, Two Pointers,Sorting Easy
0976 Largest Perimeter Triangle Array, Math, Greedy, Sorting Easy
0977 Sorted Squares Array, Two Pointers,Sorting Easy
1013 Partition Array Into Three Parts With Equal Sum Array,Greedy, Easy
1025 Divisor Game Math,Dynamic Programming, BrainTeaser, Game Theory Easy
1045 Customers Who Bought All Products Databases Easy
1128 Number of Equivalent Domino Pairs Array, Hash Table, Counting Easy
1207 Unique Number of Occurrences Array,Hash Table, Easy
1208 Get Equal Substrings Within Budget Strings,Binary Search,Sliding Window, Prefix Sum Medium
1219 Path with Maximum Gold Array,Backtracking,Matrix Medium
1221 Split a String in Balanced Strings String,Greedy,Counting Easy
1394 Find Lucky Number in an Array Array,Hash Table,Counting Easy
1399 Count Largest Group Hash Table, Math Easy
1422 Maximum Score After Splitting A String String,Prefix Sum Easy
1534 Count Good Triplets Array, Enumeration Easy
1550 Three Consecutive Odds Array Easy
1636 Sort Array by Increasing Frequency Array,Hash Table,Sorting Easy
1695 Maximum Erasure Value Array,Hash Table,Sliding Window,Weekly Contest 220 Medium
1700 Number of Students Unable to Eat Lunch Array,Stack,Queue,Simulation Easy
1752 Check if Array Is Sorted and Rotated Array Easy
1791 Find Center of Star Graph Graph Medium
1865 Finding Pairs With a Certain Sum Array, Hash Table, Design Medium
1913 Maximum Product Difference Between Two Pairs Array, Sorting Easy
1957 Delete Characters to Make Fancy String String, Biweekly Contest 58 Easy
1984 Minimu Differences Between Highest & Lowest of K Scores Array, Sliding Window, Sorting Easy
2016 Maximum Difference Between Increasing Elements Array Easy
2044 Count Number of Maximum Bitwise-OR Subsets Array, Backtracking, Bit Manipulation, Enumeration Medium
2094 Finding 3-Digit Even Numbers Array, Hash Table, Sorting, Enumeration Easy
2114 Maximum Number of Words Found in Sentences Array, String Easy
2200 Find All K-Distant Indices in an Array Array, Two Pointers Easy
2309 Greatest English Letter in Upper and Lower Case Hash Table, String, Enumeration Easy
2396 Strictly Palindromic Number Math, Two Pointers, Brainteaser Medium
2406 Divide Intervals Into Minimum Number of Groups Array,Greedy,Sorting,Two Pointers,Heap,Prefix Sum Medium
2434 Using a Robot to Print the Lexicographically Smallest String Hash Table,String,Stack,Greedy Medium
2621 Sleep JavaScript Easy
2695 Array Wrapper JavaScript, Array Easy
2670 Find the Distinct Difference Array Array,Hash Table Easy
2707 Extra Characters in a String Array, Hash Table, String, Dynamic Programming, Trie Medium
2799 Count Complete Subarrays in an Array Array, Hash Table, Sliding Window Medium
2843 Count Symmetric Integeres Math Easy
2894 Divisible and Non-divisible Sums Difference Math, Enumeration Easy
2903 Find Indices With Index and Value Difference I Array, Two Pointers Easy
2929 Distribute Candies Among Children II Math, Combinatronics, Enumeration Easy
2942 Find Words Containing Character Array, String Easy
2960 Count Tested Devices After Test Operations Array, Simulation, Count Easy
2965 Find Missing and Repeated Values Array, Hash Table, Math, Matrix Easy
3024 Type of Triangle Math,Array, Sorting Easy
3034 Find the K-th Character in String Game I Math,Bit Manipulation,Recursion, Simulation Easy
3065 Minimum Operations to Exceed Threshold Value Array Easy
3074 Apple Redistribution into Boxes Array,Greedy,Sorting Medium
3075 Maximize Happiness of Selected Children Array,Greedy,Sorting Medium
3085 Minimum Deletions to Make String K-Special Hash Table, String, Greedy,Sorting, Counting Medium
3110 Score of a String Array Easy
3122 Minimum Number of Operations to Satisfy Conditions Array Easy
3136 Valid Word String Easy
3174 Clear Digits String,Simulation, Stack Easy
3201 Find the Maximum Length of Valid Subsequence I Array, Dynamic Programming Easy
3216 Lexicographically Smallest String After a Swap String, Greedy Easy
3304 Find the K-th Character in String Game I Math,Bit Manipulation,Recursion, Simulation Easy
3309 Maximum Possible Number by Binary Concatenation Array,Bit Manipulation,Enumeration Easy
3318 Find X-Sum of All K-Long Subarrays I Array, Hash Table, Sliding Window, Heap Easy
3330 Find the Original Typed String I String Easy
3340 Check Balanced String String Easy
3345 Smallest Divisible Digit Product I Math Easy
3355 Zero Array Transformation I Array,Prefix Sum Easy
3372 Maximize the Number of Target Nodes After Connecting Trees I Tree, Depth-First-Search, Breadthth-First-Search Easy
3407 Substring Matching Pattern String, String Matching Easy
3411 Maximum SubArray With Equal Products Array, Math, Sliding Window, Enumeration, Number Theory Easy
3421 Find Students Who Improved Sql, Easy
3439 Reschedule Meetings for Maximum Free Time I Array, Hash Table, Sliding Window Medium
3442 Maximum Difference Between Even and Odd Frequency I Hash Table, String, Counting Easy
3443 Maximum Manhattan Distance After K Changes Hash Table, Math, String, Counting Easy
3483 Unique 3-Digit Even Numbers Array, Hash Table, Recursion, Enumeration Easy
3502 Minimum Cost to Reach Every Position Array, Easy

About

This project aims to provide solutions to LeetCode coding problems using both JavaScript and Python3 programming languages. One DSA challenge a day keeps the bugs away.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published