Skip to content

SamuVanoni/LeetCodePython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

675 Commits
 
 
 
 
 
 

Repository files navigation

LeetCodePython

How to practice?

  • Understand the data structure (Binary Tree)
  • Understand the algorithms of this structure (DFS)
  • Repeat the exercises in LeetCode (About the chosen algorithm)
  • Identify patterns

Repeat this for each topic

How to start? (Plan)

  1. We can start with the "Top100 Liked Questions"

  2. Then focus on the questions by topic => String, Two Pointers, Sliding Window, Binary Search, Recursion, Binary Tree, Backtracking, DFS, BFS, Graph, Linkedi List, Sort, Trie, Slack/Queue, Piority Queue, Dynamic Programming

Important => Array, String, Sorting, Counting

  1. Sort by acceptance rate rather than difficulty

  2. IMPORTANT NOTE: maximum 45 minutes per exercise! If you can't do it in that time, look at the solution. After learning the solution, look for a similar exercise and put the learning into practice.

  3. Revisit the problems

  4. Further ahead: Solve company-specific questions

# Title Solution Acceptance Difficulty Summary
1 Two Sum Python 53.5% Easy Description
4 Median of Two Sorted Arrays Python 41.3% Hard Description
11 Container With Most Water Python 56.0% Medium Description
13 Roman to Integer Python 62.5% Easy Description
20 Valid Parentheses Python 41.0% Easy Description
48 Rotate Image Python 77.1% Medium Description
75 Sort Colors Python 65.4% Medium Description
344 Reverse String Python 79.0% Easy Description
349 Intersection of Two Arrays Python 75.4% Easy Description
419 Battleships in a Board Python 76.2% Medium Description
442 Find All Duplicates in an Array Python 76.2% Medium Description
461 Hamming Distance Python 75.9% Easy Description
509 Fibonacci Number Python 72.6% Easy Description
557 Reverse Words in a String III Python 83.3% Easy Description
561 Array Partition Python 79.9% Easy Description
647 Palindromic Substrings Python 70.8% Medium Description
657 Robot Return to Origin Python 76.1% Easy Description
682 Baseball Game Python 78.1% Easy Description
696 Count Binary Substrings Python 65.7% Easy Description
709 To Lower Case Python 83.6% Easy Description
728 Self Dividing Numbers Python 79.3% Easy Description
771 Jewels and Stones Python 88.8% Easy Description
786 K-th Smallest Prime Fraction Python 68.3% Medium Description
804 Unique Morse Code Words Python 83.0% Easy Description
821 Shortest Distance to a Character Python 71.9% Easy Description
884 Uncommon Words from Two Sentences Python 75.3% Easy Description
890 Find and Replace Pattern Python 76.8% Medium Description
905 Sort Array By Parity Python 76.3% Easy Description
917 Reverse Only Letters Python 65.8% Easy Description
921 Minimum Add to Make Parentheses Valid Python 74.7% Medium Description
922 Sort Array By Parity II Python 70.9% Easy Description
942 DI String Match Python 79.6% Easy Description
961 N-Repeated Element in Size 2N Array Python 77.3% Easy Description
977 Squares of a Sorted Array Python 73.0% Easy Description
986 Interval List Intersections Python 72.0% Medium Description
1002 Find Common Characters Python 74.5% Easy Description
1021 Remove Outermost Parentheses Python 84.4% Easy Description
1051 Height Checker Python 81.0% Easy Description
1108 Defanging an IP Address Python 89.3% Easy Description
1207 Unique Number of Occurrences Python 78.0% Easy Description
1221 Split a String in Balanced Strings Python 86.4% Easy Description
1281 Subtract the Product and Sum of Digits of an Integer Python 86.6% Easy Description
1282 Group the People Given the Group Size They Belong To Python 87.4% Medium Description
1295 Find Numbers with Even Number of Digits Python 77.7% Easy Description
1304 Find N Unique Integers Sum up to Zero Python 76.2% Easy Description
1309 Decrypt String from Alphabet to Integer Python 79.9% Easy Description
1310 XOR Queries of a Subarray Python 78.5% Medium Description
1313 Decompress Run-Length Encoded List Python 85.9% Easy Description
1323 Maximum 69 Number Python 82.6% Easy Description
1332 Remove Palindromic Subsequences Python 76.6% Easy Description
1342 Number of Steps to Reduce a Number to Zero Python 85.4% Easy Description
1347 Minimum Number of Steps to Make Two Strings Anagram Python 82.1% Medium Description
1351 Count Negative Numbers in a Sorted Matrix Python 77.6% Easy Description
1356 Sort Integers by The Number of 1 Bits Python 78.6% Easy Description
1365 How Many Numbers Are Smaller Than the Current Number Python 87.0% Easy Description
1374 Generate a String With Characters That Have Odd Counts Python 78.1% Easy Description
1389 Create Target Array in the Given Order Python 86.1% Easy Description
1402 Reducing Dishes Python 76.3% Hard Description
1409 Queries on a Permutation With Key Python 84.4% Medium Description
1431 Kids With the Greatest Number of Candies Python 87.8% Easy Description
1436 Destination City Python 79.5% Easy Description
1450 Number of Students Doing Homework at a Given Time Python 75.7% Easy Description
1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence Python 64.6% Easy Description
1460 Make Two Arrays Equal by Reversing Subarrays Python 75.8% Easy Description
1464 Maximum Product of Two Elements in an Array Python 83.0% Easy Description
1470 Shuffle the Array Python 88.7% Easy Description
1475 Final Prices With a Special Discount in a Shop Python 83.1% Easy Description
1480 Running Sum of 1d Array Python 86.9% Easy Description
1486 XOR Operation in an Array Python 86.3% Easy Description
1512 Number of Good Pairs Python 89.3% Easy Description
1528 Shuffle String Python 84.9% Easy Description
1534 Count Good Triplets Python 81.6% Easy Description
1551 Minimum Operations to Make Array Equal Python 82.3% Medium Description
1561 Maximum Number of Coins You Can Get Python 84.4% Medium Description
1572 Matrix Diagonal Sum Python 83.4% Easy Description
1588 Sum of All Odd Length Subarrays Python 83.3% Easy Description
1603 Design Parking System Python 88.0% Easy Description
1614 Maximum Nesting Depth of the Parentheses Python 83.9% Easy Description
1636 Sort Array by Increasing Frequency Python 80.0% Easy Description
1641 Count Sorted Vowel Strings Python 78.7% Medium Description
1652 Defuse the Bomb Python 79.3% Easy Description
1662 Check If Two String Arrays are Equivalent Python 85.6% Easy Description
1672 Richest Customer Wealth Python 88.3% Easy Description
1678 Goal Parser Interpretation Python 87.4% Easy Description
1684 Count the Number of Consistent Strings Python 83.6% Easy Description
1688 Count of Matches in Tournament Python 85.8% Easy Description
1689 Partitioning Into Minimum Number Of Deci-Binary Numbers Python 88.7% Medium Description
1700 Number of Students Unable to Eat Lunch Python 78.5% Easy Description
1704 Determine if String Halves Are Alike Python 78.7% Easy Description
1716 Calculate Money in Leetcode Bank Python 78.5% Easy Description
1720 Decode XORed Array Python 86.7% Easy Description
1725 Number Of Rectangles That Can Form The Largest Square Python 78.9% Easy Description
1732 Find the Highest Altitude Python 83.7% Easy Description
1748 Sum of Unique Elements Python 78.7% Easy Description
1768 Merge Strings Alternately Python 80.8% Easy Description
1769 Minimum Number of Operations to Move All Balls to Each Box Python 86.0% Medium Description
1773 Count Items Matching a Rule Python 84.7% Easy Description
1812 Determine Color of a Chessboard Square Python 78.8% Easy Description
1816 Truncate Sentence Python 85.6% Easy Description
1827 Minimum Operations to Make the Array Increasing Python 80.6% Easy Description
1832 Check if the Sentence Is Pangram Python 83.6% Easy Description
1837 Sum of Digits in Base K Python 77.7% Easy Description
1844 Replace All Digits with Characters Python 81.7% Easy Description
1859 Sorting the Sentence Python 83.5% Easy Description
1877 Minimize Maximum Pair Sum in Array Python 81.4% Medium Description
1880 Check if Word Equals Summation of Two Words Python 74.6% Easy Description
1910 Remove All Occurrences of a Substring Python 78.0% Medium Description
1913 Maximum Product Difference Between Two Pairs Python 82.9% Easy Description
1920 Build Array from Permutation Python 90.1% Easy Description
1929 Concatenation of Array Python 90.2% Easy Description
1941 Check if All Characters Have Equal Number of Occurrences Python 78.0% Easy Description
1963 Minimum Number of Swaps to Make the String Balanced Python 78.0% Medium Description
1967 Number of Strings That Appear as Substrings in Word Python 81.2% Easy Description
1974 Minimum Time to Type Word Using Special Typewriter Python 76.8% Easy Description
1979 Find Greatest Common Divisor of Array Python 78.5% Easy Description
2000 Reverse Prefix of Word Python 86.3% Easy Description
2006 Count Number of Pairs With Absolute Difference K Python 84.4% Easy Description
2011 Final Value of Variable After Performing Operations Python 89.4% Easy Description
2023 Number of Pairs of Strings With Concatenation Equal to Target Python 75.1% Medium Description
2037 Minimum Number of Moves to Seat Everyone Python 87.4% Easy Description
2053 Kth Distinct String in an Array Python 82.0% Easy Description
2089 Find Target Indices After Sorting Array Python 77.1% Easy Description
2103 Rings and Rods Python 80.9% Easy Description
2108 Find First Palindromic String in the Array Python 83.9% Easy Description
2114 Maximum Number of Words Found in Sentences Python 86.6% Easy Description
2119 A Number After a Double Reversal Python 80.9% Easy Description
2125 Number of Laser Beams in a Bank Python 85.6% Medium Description
2149 Rearrange Array Elements by Sign Python 84.1% Medium Description
2160 Minimum Sum of Four Digit Number After Splitting Digits Python 86.2% Easy Description
2161 Partition Array According to Given Pivot Python 85.2% Medium Description
2169 Count Operations to Obtain Zero Python 74.7% Easy Description
2176 Count Equal and Divisible Pairs in an Array Python 79.5% Easy Description
2185 Counting Words With a Given Prefix Python 78.4% Easy Description
2194 Cells in a Range on an Excel Sheet Python 83.9% Easy Description
2215 Find the Difference of Two Arrays Python 80.2% Easy Description
2220 Minimum Bit Flips to Convert Number Python 87.4% Easy Description
2221 Find Triangular Sum of an Array Python 78.8% Medium Description
2235 Add Two Integers Python 88.0% Easy Description
2315 Count Asterisks Python 82.4% Easy Description
2317 Maximum XOR After Operations Python 79.3% Medium Description
2325 Decode the Message Python 84.7% Easy Description
2341 Maximum Number of Pairs in Array Python 75.5% Easy Description
2363 Merge Similar Items Python 76.6% Easy Description
2367 Number of Arithmetic Triplets Python 84.5% Easy Description
2390 Removing Stars From a String Python 77.3% Medium Description
2391 Minimum Amount of Time to Collect Garbage Python 85.2% Medium Description
2410 Maximum Matching of Players With Trainers Python 64.5% Medium Description
2413 Smallest Even Multiple Python 88.0% Easy Description
2418 Sort the People Python 84.9% Easy Description
2427 Number of Common Factors Python 79.4% Easy Description
2433 Find The Original Array of Prefix Xor Python 88.0% Medium Description
2441 Largest Positive Integer That Exists With Its Negative Python 75.0% Easy Description
2442 Count Number of Distinct Integers After Reverse Operations Python 80.0% Medium Description
2460 Apply Operations to an Array Python 68.2% Easy Description
2469 Convert the Temperature Python 89.9% Easy Description
2485 Find the Pivot Integer Python 83.8% Easy Description
2486 Append Characters to String to Make Subsequence Python 73.0% Medium Description
2500 Delete Greatest Value in Each Row Python 78.7% Easy Description
2520 Count the Digits That Divide a Number Python 85.2% Easy Description
2529 Maximum Count of Positive Integer and Negative Integer Python 74.5% Easy Description
2535 Difference Between Element Sum and Digit Sum of an Array Python 84.8% Easy Description
2553 Separate the Digits in an Array Python 80.0% Easy Description
2562 Find the Array Concatenation Value Python 70.4% Easy Description
2570 Merge Two 2D Arrays by Summing Values Python 74.0% Easy Description
2574 Left and Right Sum Differences Python 87.1% Easy Description
2651 Calculate Delayed Arrival Time Python 77.5% Easy Description
2652 Sum Multiples Python 85.2% Easy Description
2656 Maximum Sum With Exactly K Elements Python 81.7% Easy Description
2670 Find the Distinct Difference Array Python 77.6% Easy Description
2678 Number of Senior Citizens Python 81.7% Easy Description
2696 Minimum String Length After Removing Substrings Python 77.5% Easy Description
2697 Lexicographically Smallest Palindrome Python 82.3% Easy Description
2710 Remove Trailing Zeros From a String Python 78.9% Easy Description
2716 Minimize String Length Python 76.9% Easy Description
2733 Neither Minimum nor Maximum Python 76.3% Easy Description
2744 Find Maximum Number of String Pairs Python 81.9% Easy Description
2769 Find the Maximum Achievable Number Python 90.9% Easy Description
2778 Sum of Squares of Special Elements Python 81.1% Easy Description
2785 Sort Vowels in a String Python 80.7% Medium Description
2788 Split Strings by Separator Python 75.6% Easy Description
2798 Number of Employees Who Met the Target Python 87.7% Easy Description
2810 Faulty Keyboard Python 84.1% Easy Description
2824 Count Pairs Whose Sum is Less than Target Python 87.5% Easy Description
2828 Check if a String Is an Acronym of Words Python 83.2% Easy Description
2859 Sum of Values at Indices With K Set Bits Python 86.0% Easy Description
2864 Maximum Odd Binary Number Python 83.2% Easy Description
2880 Select Data Python 79.3% Easy Description
2894 Divisible and Non-divisible Sums Difference Python 89.3% Easy Description
2913 Subarrays Distinct Element Sum of Squares I Python 81.8% Easy Description
2932 Maximum Strong Pair XOR I Python 75.4% Easy Description
2938 Separate Black and White Balls Python 64.9% Medium Description
2942 Find Words Containing Character Python 88.7% Easy Description
2951 Find the Peaks Python 75.3% Easy Description
2956 Find Common Elements Between Two Arrays Python 83.8% Easy Description
2960 Count Tested Devices After Test Operations Python 79.6% Easy Description
2974 Minimum Number Game Python 85.5% Easy Description
3005 Count Elements With Maximum Frequency Python 78.3% Easy Description
3016 Minimum Number of Pushes to Type Word II Python 80.7% Medium Description
3019 Number of Changing Keys Python 81.0% Easy Description
3042 Count Prefix and Suffix Pairs I Python 77.8% Easy Description
3065 Minimum Operations to Exceed Threshold Value I Python 85.8% Easy Description
3099 Harshad Number Python 83.0% Easy Description
3110 Score of a String Python 93.1% Easy Description
3131 Find the Integer Added to Array I Python 81.9% Easy Description
3146 Permutation Difference between Two Strings Python 89.2% Easy Description
3158 Find the XOR of Numbers Which Appear Twice Python 81.0% Easy Description
3162 Find the Number of Good Pairs I Python 85.8% Easy Description
3168 Minimum Number of Chairs in a Waiting Room Python 80.6% Easy Description
3184 Count Pairs That Form a Complete Day I Python 78.2% Easy Description
3190 Find Minimum Operations to Make All Elements Divisible by Three Python 89.6% Easy Description
3194 Minimum Average of Smallest and Largest Elements Python 85.4% Easy Description
3223 Minimum Length of String After Operations Python 75.2% Medium Description
3232 Find if Digit Game Can Be Won Python 82.3% Easy Description
3239 Minimum Number of Flips to Make Binary Grid Palindromic I Python 78.3% Medium Description
3248 Snake in Matrix Python 82.1% Easy Description
3270 Find the Key of the Numbers Python 76.9% Easy Description
3271 Hash Divided String Python 84.6% Medium Description
3280 Convert Date to Binary Python 88.2% Easy Description
3285 Find Indices of Stable Mountains Python 86.8% Easy Description
3289 The Two Sneaky Numbers of Digitville Python 88.9% Easy Description
3300 Minimum Element After Replacement With Digit Sum Python 83.8% Easy Description
3324 Find the Sequence of Strings Appeared on the Screen Python 80.4% Medium Description
3340 Check Balanced String Python 83.4% Easy Description
3370 Smallest Number With All Set Bits Python 76.6% Easy Description
3432 Count Partitions with Even Sum Difference Python 79.5% Easy Description

About

Python solutions for LeetCode problems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages