Skip to content

hpmsora/Python---LeetCode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Project - LeetCode

Order Title Solution Difficulty
0001 Two Sum Python3 Easy
0002 Add Two Numbers Python3 Medium
0003 longest-substring-without-repeating-characters Python3 Medium
0004 Median of Two Sorted Arrays Python3 Hard
0005 Longest Palindromic Substring Python3 Medium
0006 Zigzag Conversion Python3 Medium
0007 Reverse Integer Python3 Medium
0008 String to Integer (atoi) Python3 Medium
0009 Palindrome Number Python3 Easy
0011 Container With Most Water Python3 Medium
0012 Integer to Roman Python3 Medium
0013 Roman to Integer Python3 Easy
0014 Longest Common Prefix Python3 Easy
0015 3Sum Python3 Medium
0017 Letter Combinations of a Phone Number Python3 Medium
0019 Remove Nth Node From End of List Python3 Medium
0020 Valid Parentheses Python3 Easy
0021 Merge Two Sorted Lists Python3 Easy
0023 Merge k Sorted Lists Python3 Hard
0024 Swap Nodes in Pairs Python3 Medium
0026 Remove Duplicates from Sorted Array Python3 Easy
0027 Remove Element Python3 Easy
0028 Find the Index of the First Occurrence in a String Python3 Easy
0029 Divide Two Integers Python3 Medium
0030 Substring with Concatenation of All Words Python3 Hard
0031 Next Permutation Python3 Medium
0034 Find First and Last Position of Element in Sorted Array Python3 Medium
0035 0035_Search_Insert_Position Python3 Easy
0036 Valid Sudoku Python3 Medium
0038 Count and Say Python3 Medium
0039 Combination Sum Python3 Medium
0042 First Missing Positive Python3 Hard
0042 Trapping Rain Water Python3 Hard
0045 Jump Game II Python3 Medium
0046 Permutations Python3 Medium
0048 Rotate Image Python3 Medium
0049 Group Anagrams Python3 Medium
0050 Pow(x, n) Python3 Medium
0054 Spiral Matrix Python3 Medium
0055 Jump Game Python3 Medium
0056 Merge Intervals Python3 Medium
0057 Insert Interval Python3 Medium
0058 Length of Last Word Python3 Easy
0061 Rotate List Python3 Medium
0062 Unique Paths Python3 Medium
0063 Unique Paths II Python3 Medium
0064 Minimum Path Sum Python3 Medium
0065 Valid Number Python3 Hard
0066 Plus One Python3 Easy
0067 Add Binary Python3 Easy
0068 Text Justification Python3 Hard
0069 Sqrt(x) Python3 Easy
0070 Climbing Stairs Python3 Easy
0071 Simplify Path Python3 Medium
0073 Set Matrix Zeroes Python3 Medium
0074 Search a 2D Matrix Python3 Medium
0077 Combinations Python3 Medium
0079 Word Search Python3 Medium
0080 Remove Duplicates from Sorted Array II Python3 Medium
0082 Remove Duplicates from Sorted List II Python3 Medium
0083 Remove Duplicates from Sorted List Python3 Easy
0086 Partition List Python3 Medium
0088 Merge Sorted Array Python3 Easy
0092 Reverse Linked List II Python3 Medium
0098 Validate Binary Search Tree Python3 Medium
0100 Same Tree Python3 Easy
0101 Symmetric Tree Python3 Easy
0102 Binary Tree Level Order Traversal Python3 Medium
0103 Binary Tree Zigzag Level Order Traversal Python3 Medium
0105 Construct Binary Tree from Preorder and Inorder Traversal Python3 Medium
0108 Convert Sorted Array to Binary Search Tree Python3 Easy
0110 Balanced Binary Tree Python3 Easy
0111 Minimum Depth of Binary Tree Python3 Easy
0112 Path Sum Python3 Easy
0114 Flatten Binary Tree to Linked List Python3 Medium
0117 Populating Next Right Pointers in Each Node II Python3 Medium
0118 Pascal's Triangle Python3 Easy
0120 Triangle Python3 Medium
0122 Best Time to Buy and Sell Stock II Python3 Medium
0124 Binary Tree Maximum Path Sum Python3 Hard
0125 Valid Palindrome Python3 Easy
0128 Longest Consecutive Sequence Python3 Medium
0129 Sum Root to Leaf Numbers Python3 Medium
0130 Surrounded Regions Python3 Medium
0133 Clone Graph Python3 Medium
0134 Gas Station Python3 Medium
0135 Candy Python3 Hard
0136 Single Number Python3 Easy
0136 Copy List with Random Pointer Python3 Medium
0141 Linked List Cycle Python3 Easy
0143 Reorder List Python3 Medium
0144 Binary Tree Preorder Traversal Python3 Easy
0146 LRU Cache Python3 Medium
0148 Sort List Python3 Medium
0150 Evaluate Reverse Polish Notation Python3 Medium
0151 Reverse Words in a String Python3 Medium
0155 Min Stack Python3 Medium
0157 Read N Characters Given Read4 Python3 Easy
0162 Find Peak Element Python3 Medium
0163 Missing Ranges Python3 Easy
0166 Fraction to Recurring Decimal Python3 Medium
0167 Two Sum II - Input Array Is Sorted Python3 Medium
0172 Factorial Trailing Zeroes Python3 Medium
0173 Binary Search Tree Iterator Python3 Medium
0190 Reverse Bits Python3 Easy
0191 Number of 1 Bits Python3 Easy
0198 House Robber Python3 Medium
0199 Binary Tree Right Side View Python3 Medium
0202 Happy Number Python3 Easy
0205 Isomorphic Strings Python3 Easy
0206 Reverse Linked List Python3 Easy
0208 Implement Trie (Prefix Tree) Python3 Medium
0209 Minimum Size Subarray Sum Python3 Medium
0215 Kth Largest Element in an Array Python3 Medium
0217 Contains Duplicate Python3 Easy
0219 Contains Duplicate II Python3 Easy
0222 Count Complete Tree Nodes Python3 Easy
0226 Invert Binary Tree Python3 Easy
0227 Basic Calculator II Python3 Medium
0228 Summary Ranges Python3 Easy
0230 Kth Smallest Element in a BST Python3 Medium
0232 Implement Queue using Stacks Python3 Easy
0234 Palindrome Linked List Python3 Easy
0236 Lowest Common Ancestor of a Binary Tree Python3 Medium
0238 Product of Array Except Self Python3 Medium
0242 Valid Anagram Python3 Easy
0246 Strobogrammatic Number Python3 Easy
0249 Group Shifted Strings Python3 Medium
0253 Meeting Rooms II Python3 Medium
0266 Palindrome Permutation Python3 Easy
0268 Missing Number Python3 Easy
0270 Closest Binary Search Tree Value Python3 Easy
0274 H-Index Python3 Medium
0277 Find the Celebrity Python3 Medium
0279 Perfect Squares Python3 Medium
0282 Expression Add Operators Python3 Hard
0283 Move Zeroes Python3 Easy
0287 Find the Duplicate Number Python3 Medium
0290 Word Pattern Python3 Medium
0300 Longest Increasing Subsequence Python3 Medium
0303 Range Sum Query - Immutable Python3 Easy
0304 Range Sum Query 2D - Immutable Python3 Medium
0314 Binary Tree Vertical Order Traversal Python3 Medium
0319 Bulb Switcher Python3 Medium
0322 Coin Change Python3 Medium
0325 Maximum Size Subarray Sum Equals k Python3 Medium
0339 Nested List Weight Sum Python3 Medium
0340 Longest Substring with At Most K Distinct Characters Python3 Medium
0345 Reverse Vowels of a String Python3 Easy
0346 Moving Average from Data Stream Python3 Easy
0347 Top K Frequent Elements Python3 Medium
0348 Design Tic-Tac-Toe Python3 Medium
0349 Intersection of Two Arrays Python3 Easy
0350 Intersection of Two Arrays II Python3 Easy
0364 Nested List Weight Sum II Python3 Medium
0378 Nested List Weight Sum II Python3 Medium
0380 Insert Delete GetRandom O(1) Python3 Medium
0387 First Unique Character in a String Python3 Easy
0389 Find the Difference Python3 Easy
0398 Random Pick Index Python3 Medium
0399 Evaluate Division Python3 Medium
0408 Valid Word Abbreviation Python3 Easy
0414 Third Maximum Number Python3 Easy
0417 Pacific Atlantic Water Flow Python3 Medium
0426 Convert Binary Search Tree to Sorted Doubly Linked List Python3 Medium
0433 Minimum Genetic Mutation Python3 Medium
0442 Find All Duplicates in an Array Python3 Medium
0443 String Compression Python3 Medium
0451 String Compression Python3 Medium
0451 Minimum Number of Arrows to Burst Balloons Python3 Medium
0455 Arithmetic Slices II - Subsequence Python3 Hard
0455 Assign Cookies Python3 Easy
0459 Repeated Substring Pattern Python3 Easy
0463 Island Perimeter Python3 Easy
0494 Target Sum Python3 Medium
0498 Diagonal Traverse Python3 Medium
0501 Repeated Substring Pattern Python3 Easy
0513 Find Bottom Left Tree Value Python3 Medium
0515 Find Largest Value in Each Tree Row Python3 Medium
0523 Continuous Subarray Sum Python3 Medium
0525 Contiguous Array Python3 Medium
0528 Random Pick with Weight Python3 Medium
0530 Minimum Absolute Difference in BST Python3 Easy
0543 Diameter of Binary Tree Python3 Easy
0551 Student Attendance Record I Python3 Easy
0560 Subarray Sum Equals K Python3 Medium
0567 Permutation in String Python3 Medium
0572 Subtree of Another Tree Python3 Easy
0605 Can Place Flowers Python3 Easy
0621 Task Scheduler Python3 Medium
0632 Smallest Range Covering Elements from K Lists Python3 Hard
0645 Set Mismatch Python3 Easy
0653 Two Sum IV - Input is a BST Python3 Easy
0658 Find K Closest Elements Python3 Medium
0670 Maximum Swap Python3 Medium
0674 Longest Continuous Increasing Subsequence Python3 Easy
0678 Valid Parenthesis String Python3 Medium
0680 Valid Palindrome II Python3 Easy
0689 Maximum Sum of 3 Non-Overlapping Subarrays Python3 Hard
0703 Kth Largest Element in a Stream Python3 Easy
0708 Insert into a Sorted Circular Linked List Python3 Medium
0713 Subarray Product Less Than K Python3 Medium
0721 Accounts Merge Python3 Medium
0739 Network Delay Time Python3 Medium
0743 Network Delay Time Python3 Medium
0766 Toeplitz Matrix Python3 Easy
0769 Max Chunks To Make Sorted Python3 Medium
0773 Sliding Puzzle Python3 Hard
0785 Is Graph Bipartite? Python3 Medium
0791 Custom Sort String Python3 Medium
0796 Rotate String Python3 Easy
0824 Goat Latin Python3 Easy
0827 Making A Large Island Python3 Hard
0859 Buddy Strings Python3 Easy
0863 Shortest Subarray with Sum at Least K Python3 Hard
0863 All Nodes Distance K in Binary Tree Python3 Medium
0865 Smallest Subtree with all the Deepest Nodes Python3 Medium
0872 Leaf-Similar Trees Python3 Easy
0876 Middle of the Linked List Python3 Easy
0916 Word Subsets Python3 Medium
0921 Minimum Add to Make Parentheses Valid Python3 Medium
0930 Binary Subarrays With Sum Python3 Medium
0931 Minimum Falling Path Sum Python3 Medium
0938 Range Sum of BST Python3 Easy
0948 Bag of Tokens Python3 Medium
0950 Reveal Cards In Increasing Order Python3 Medium
0951 Flip Equivalent Binary Trees Python3 Medium
0953 Verifying an Alien Dictionary Python3 Easy
0957 Prison Cells After N Days Python3 Medium
0957 Check Completeness of a Binary Tree Python3 Medium
0973 K Closest Points to Origin Python3 Medium
0977 Squares of a Sorted Array Python3 Easy
0983 Minimum Cost For Tickets Python3 Medium
0986 Interval List Intersections Python3 Medium
0987 Vertical Order Traversal of a Binary Tree Python3 Hard
0992 Subarrays with K Different Integers Python3 Hard
1004 Max Consecutive Ones III Python3 Medium
1014 Best Sightseeing Pair Python3 Medium
1026 Maximum Difference Between Node and Ancestor Python3 Medium
1027 Longest Arithmetic Subsequence Python3 Medium
1047 Remove All Adjacent Duplicates In String Python3 Easy
1047 Remove Vowels from a String Python3 Easy
1072 Flip Columns For Maximum Number of Equal Rows Python3 Medium
1091 Shortest Path in Binary Matrix Python3 Medium
1106 Parsing A Boolean Expression Python3 Hard
1137 N-th Tribonacci Number Python3 Medium
1171 Remove Zero Sum Consecutive Nodes from Linked List Python3 Medium
1176 Diet Plan Performance Python3 Easy
1207 Unique Number of Occurrences Python3 Easy
1213 Intersection of Three Sorted Arrays Python3 Easy
1216 Valid Palindrome III Python3 Hard
1235 Maximum Profit in Job Scheduling Python3 Hard
1249 Minimum Remove to Make Valid Parentheses Python3 Medium
1266 Minimum Time Visiting All Points Python3 Easy
1291 Sequential Digits Python3 Medium
1329 Sort the Matrix Diagonally Python3 Medium
1331 Rank Transform of an Array Python3 Easy
1346 Check If N and Its Double Exist Python3 Easy
1400 Construct K Palindrome Strings Python3 Medium
1408 String Matching in an Array Python3 Easy
1422 Maximum Score After Splitting a String Python3 Easy
1427 Perform String Shifts Python3 Easy
1436 Destination City Python3 Easy
1443 Minimum Time to Collect All Apples in a Tree Python3 Medium
1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence Python3 Easy
1469 Find All The Lonely Nodes Python3 Easy
1492 The kth Factor of n Python3 Medium
1528 Shuffle String Python3 Easy
1539 Kth Missing Positive Number Python3 Easy
1544 Make The String Great Python3 Easy
1545 Find Kth Bit in Nth Binary String Python3 Medium
1570 Dot Product of Two Sparse Vectors Python3 Medium
1574 Shortest Subarray to be Removed to Make Array Sorted Python3 Medium
1578 Minimum Time to Make Rope Colorful Python3 Medium
1609 Even Odd Tree Python3 Medium
1614 Maximum Nesting Depth of the Parentheses Python3 Easy
1639 Number of Ways to Form a Target String Given a Dictionary Python3 Hard
1644 Lowest Common Ancestor of a Binary Tree II Python3 Medium
1650 Lowest Common Ancestor of a Binary Tree III Python3 Medium
1652 Defuse the Bomb Python3 Easy
1662 Check If Two String Arrays are Equivalent Python3 Easy
1669 Merge In Between Linked Lists Python3 Medium
1700 Number of Students Unable to Eat Lunch Python3 Easy
1704 Determine if String Halves Are Alike Python3 Easy
1750 Minimum Length of String After Deleting Similar Ends Python3 Medium
1760 Minimum Limit of Balls in a Bag Python3 Medium
1762 Buildings With an Ocean View Python3 Medium
1768 Merge Strings Alternately Python3 Easy
1769 Minimum Number of Operations to Move All Balls to Each Box Python3 Medium
1791 Find Center of Star Graph Python3 Easy
1792 Maximum Average Pass Ratio Python3 Meidum
1829 Maximum XOR for Each Query Python3 Meidum
1861 Rotating the Box Python3 Meidum
1891 Cutting Ribbons Python3 Meidum
1897 Redistribute Characters to Make All Strings Equal Python3 Easy
1930 Unique Length-3 Palindromic Subsequences Python3 Meidum
1942 The Number of the Smallest Unoccupied Chair Python3 Meidum
1957 Delete Characters to Make Fancy String Python3 Easy
1963 Minimum Number of Swaps to Make the String Balanced Python3 Meidum
1975 Maximum Matrix Sum Python3 Meidum
2054 Two Best Non-Overlapping Events Python3 Meidum
2064 Minimized Maximum of Products Distributed to Any Store Python3 Meidum
2070 Most Beautiful Item for Each Query Python3 Meidum
2073 Time Needed to Buy Tickets Python3 Easy
2097 Valid Arrangement of Pairs Python3 Hard
2108 Find First Palindromic String in the Array Python3 Medium
2109 Adding Spaces to a String Python3 Medium
2116 Check if a Parentheses String Can Be Valid Python3 Medium
2125 Number of Laser Beams in a Bank Python3 Medium
2149 Rearrange Array Elements by Sign Python3 Medium
2168 Unique Substrings With Equal Digit Frequency Python3 Medium
2182 Construct String With Repeat Limit Python3 Medium
2185 Counting Words With a Given Prefix Python3 Easy
2225 Find Players With Zero or One Losses Python3 Medium
2257 Count Unguarded Cells in the Grid Python3 Medium
2270 Number of Ways to Split Array Python3 Medium
2275 Largest Combination With Bitwise AND Greater Than Zero Python3 Medium
2290 Minimum Obstacle Removal to Reach Corner Python3 Hard
2330 Valid Palindrome IV Python3 Hard
2337 Move Pieces to Obtain a String Python3 Medium
2381 Shifting Letters II Python3 Medium
2385 Amount of Time for Binary Tree to Be Infected Python3 Medium
2415 Reverse Odd Levels of Binary Tree Python3 Medium
2418 Sort the People Python3 Easy
2429 Minimize XOR Python3 Medium
2444 Count Subarrays With Fixed Bounds Python3 Hard
2461 Maximum Sum of Distinct Subarrays With Length K Python3 Medium
2466 Count Ways To Build Good Strings Python3 Medium
2485 Find the Pivot Integer Python3 Easy
2490 Circular Sentence Python3 Easy
2516 Take K of Each Character From Left and Right Python3 Medium
2530 Maximal Score After Applying K Operations Python3 Medium
2540 Minimum Common Value Python3 Easy
2554 Maximum Number of Integers to Choose From a Range I Python3 Medium
2558 Take Gifts From the Richest Pile Python3 Easy
2559 Count Vowel Strings in Ranges Python3 Medium
2563 Count the Number of Fair Pairs Python3 Medium
2577 Minimum Time to Visit a Cell In a Grid Python3 Hard
2583 Kth Largest Sum in a Binary Tree Python3 Medium
2593 Find Score of an Array After Marking All Elements Python3 Medium
2601 Prime Subtraction Operation Python3 Medium
2610 Convert an Array Into a 2D Array With Conditions Python3 Medium
2641 Cousins in Binary Tree II Python3 Medium
2657 Find the Prefix Common Array of Two Arrays Python3 Medium
2696 Minimum String Length After Removing Substrings Python3 Easy
2762 Continuous Subarrays Python3 Medium
2769 Find the Maximum Achievable Number Python3 Easy
2779 Maximum Beauty of an Array After Applying Operation Python3 Medium
2810 Faulty Keyboard Python3 Easy
2825 Make String a Subsequence Using Cyclic Increments Python3 Easy
2864 Maximum Odd Binary Number Python3 Easy
2870 Minimum Number of Operations to Make Array Empty Python3 Medium
2914 Minimum Number of Changes to Make Binary String Beautiful Python3 Medium
2924 Find Champion II Python3 Medium
2938 Separate Black and White Balls Python3 Medium
2951 Find the Peaks Python3 Easy
2956 Find Common Elements Between Two Arrays Python3 Easy
2958 Length of Longest Subarray With at Most K Frequency Python3 Medium
2962 Count Subarrays Where Max Element Appears at Least K Times Python3 Medium
2965 Find Missing and Repeated Values Python3 Easy
2971 Find Polygon With the Largest Perimeter Python3 Medium
2981 Find Longest Special Substring That Occurs Thrice I Python3 Medium
3005 Count Elements With Maximum Frequency Python3 Easy
3011 Find if Array Can Be Sorted Python3 Medium
3042 Count Prefix and Suffix Pairs I Python3 Easy
3062 Winner of the Linked List Game Python3 Easy
3063 Linked List Frequency Python3 Easy
3097 Shortest Subarray With OR at Least K II Python3 Medium
3133 Minimum Array End Python3 Medium
3152 Special Array II Python3 Medium
3163 String Compression III Python3 Medium
3203 Find Minimum Diameter After Merging Two Trees Python3 Medium
3223 Minimum Length of String After Operations Python3 Medium
3243 Shortest Distance After Road Addition Queries I Python3 Medium
3254 Find the Power of K-Size Subarrays I Python3 Medium
3264 Final Array State After K Multiplication Operations I Python3 Medium

About

LeetCode Practice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published