# Fuck LeetCode ## Best practices for LeetCode solutions Dear LeetCoders! For a better LeetCode problem-solving experience, please visit website [LeetCode Python](https://leetcodepython.com): Dare to claim the best practices of LeetCode solutions! Will save you a lot of time! Hi there! I'm Lane. Do you feel that there are too many problems (over 3,450) on the LeetCode and you can't finish them all? Or do you forget how to solve the problems you did last time? If you can master some solution patterns, this will happen less often. Here, I will provide you with **common problem-solving patterns** so that you don't waste time on problems that are not often tested in interviews. **Python, C++, Java, JavaScript, C#, Go, Ruby** languages' solutions are provided for every selected LeetCode problem. Other languages' solutions will be provided in the future. If you have better solutions, welcome to create an issue or PR! ## How to fully demonstrate your abilities to employers and get the offer you want? [Developer Portfolio](https://github.com/developer-portfolios/developer-portfolio) focuses on bringing value to developers, including resume, portfolio, blog and other functions. With it, your abilities will be better seen by employers! ## How to Use this "Fuck LeetCode" Repository? I have planned a learning route for you. You just need to do the problems in the order they are listed. You can skip the more difficult problems and do them later. ## Array - [344. Reverse String](en/1-1000/344-reverse-string.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [27. Remove Element](en/1-1000/27-remove-element.md) Python, Java, C++, JavaScript, C#, Go, Ruby, **2** approaches. - [704. Binary Search](en/1-1000/704-binary-search.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [977. Squares of a Sorted Array](en/1-1000/977-squares-of-a-sorted-array.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [209. Minimum Size Subarray Sum](en/1-1000/209-minimum-size-subarray-sum.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [303. Range Sum Query - Immutable](en/1-1000/303-range-sum-query-immutable.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [59. Spiral Matrix II](en/1-1000/59-spiral-matrix-ii.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [503. Next Greater Element II](en/1-1000/503-next-greater-element-ii.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [3478. Choose K Elements With Maximum Sum](https://leetcodepython.com/en/leetcode/3478-choose-k-elements-with-maximum-sum) Python. ## Linked List - [203. Remove Linked List Elements](en/1-1000/203-remove-linked-list-elements.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [206. Reverse Linked List](en/1-1000/206-reverse-linked-list.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [160. Intersection of Two Linked Lists](en/1-1000/160-intersection-of-two-linked-lists.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [19. Remove Nth Node From End of List](en/1-1000/19-remove-nth-node-from-end-of-list.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [707. Design Linked List](en/1-1000/707-design-linked-list.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [24. Swap Nodes in Pairs](en/1-1000/24-swap-nodes-in-pairs.md) Python, Java, C++, JavaScript, C#, Go, Ruby. ## Hash Table - [349. Intersection of Two Arrays](en/1-1000/349-intersection-of-two-arrays.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [242. Valid Anagram](en/1-1000/242-valid-anagram.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [1. Two Sum](en/1-1000/1-two-sum.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [383. Ransom Note](en/1-1000/383-ransom-note.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [202. Happy Number](en/1-1000/202-happy-number.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [454. 4Sum II](en/1-1000/454-4sum-ii.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [49. Group Anagrams](https://leetcodepython.com/en/leetcode/49-group-anagrams) Python, Ruby. ## String - [28. Find the Index of the First Occurrence in a String](en/1-1000/28-find-the-index-of-the-first-occurrence-in-a-string.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [541. Reverse String II](en/1-1000/541-reverse-string-ii.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [459. Repeated Substring Pattern](en/1-1000/459-repeated-substring-pattern.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [833. Find, Replace in String](https://leetcodepython.com/en/leetcode/833-find-and-replace-in-string) Python. ## Two Pointers - [15. 3Sum](en/1-1000/15-3sum.md) Python, Java, C++, JavaScript, C#, Go, Ruby, 2 approaches. - [18. 4Sum](en/1-1000/18-4sum.md) Python, Java, C++, JavaScript, C#, Go, Ruby. ## Stack & Queue - [20. Valid Parentheses](en/1-1000/20-valid-parentheses.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [232. Implement Queue using Stacks](en/1-1000/232-implement-queue-using-stacks.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [225. Implement Stack using Queues](en/1-1000/225-implement-stack-using-queues.md) Python, Java, C++, JavaScript, C#, Go, Ruby, 3 approaches. ## Binary Tree - [144. Binary Tree Preorder Traversal](en/1-1000/144-binary-tree-preorder-traversal.md) Python, 2 approaches. ## Dynamic Programming ### Easy Problems - [509. Fibonacci Number](en/1-1000/509-fibonacci-number.md) Python, Java, C++, JavaScript, C#, Go, Ruby. ### House Robber - [198. House Robber](en/1-1000/198-house-robber.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [213. House Robber II](en/1-1000/213-house-robber-ii.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [337. House Robber III](en/1-1000/337-house-robber-iii.md) Python, Java, C++, JavaScript, C#, Go, Ruby, **2** approaches. ### Knapsack Problems #### 0/1 Knapsack - [416. Partition Equal Subset Sum](en/1-1000/416-partition-equal-subset-sum.md) Python, Java, C++, JavaScript, C#, Go, Ruby, **2** approaches. - [1049. Last Stone Weight II](en/1001-2000/1049-last-stone-weight-ii.md) Python, Java, C++, JavaScript, C#, Go, Ruby, **2** approaches. - [494. Target Sum](en/1-1000/494-target-sum.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [474. Ones and Zeroes](en/1-1000/474-ones-and-zeroes.md) Python, Java, C++, JavaScript, C#, Go, Ruby. #### Unbounded Knapsack - [518. Coin Change II](en/1-1000/518-coin-change-ii.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [377. Combination Sum IV](en/1-1000/377-combination-sum-iv.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [322. Coin Change](en/1-1000/322-coin-change.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [279. Perfect Squares](en/1-1000/279-perfect-squares.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [139. Word Break](en/1-1000/139-word-break.md) Python, Java, C++, JavaScript, C#, Go, Ruby. ### Stock Maximum Profit Problems - [121. Best Time to Buy and Sell Stock](en/1-1000/121-best-time-to-buy-and-sell-stock.md) Python, JavaScript, Go. - [122. Best Time to Buy and Sell Stock II](en/1-1000/122-best-time-to-buy-and-sell-stock-ii.md) Python, JavaScript, Go. - [714. Best Time to Buy and Sell Stock with Transaction Fee](en/1-1000/714-best-time-to-buy-and-sell-stock-with-transaction-fee.md) Python, JavaScript, Go. - [123. Best Time to Buy and Sell Stock III](en/1-1000/123-best-time-to-buy-and-sell-stock-iii.md) Python, JavaScript, Go. - [188. Best Time to Buy and Sell Stock IV](en/1-1000/188-best-time-to-buy-and-sell-stock-iv.md) Python, JavaScript, Go. - [309. Best Time to Buy and Sell Stock with Cooldown](en/1-1000/309-best-time-to-buy-and-sell-stock-with-cooldown.md) Python, JavaScript, Go. ### Subsequence Problems - [674. Longest Continuous Increasing Subsequence](en/1-1000/674-longest-continuous-increasing-subsequence.md) Python, Java, JavaScript, C#. - [300. Longest Increasing Subsequence](en/1-1000/300-longest-increasing-subsequence.md) Python, Java, JavaScript, C#. - [718. Maximum Length of Repeated Subarray](en/1-1000/718-maximum-length-of-repeated-subarray.md) Python, Java, JavaScript, C#. - [1143. Longest Common Subsequence](en/1001-2000/1143-longest-common-subsequence.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [1035. Uncrossed Lines](en/1001-2000/1035-uncrossed-lines.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [53. Maximum Subarray](en/1-1000/53-maximum-subarray.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [392. Is Subsequence](en/1-1000/392-is-subsequence.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [583. Delete Operation for Two Strings](en/1-1000/583-delete-operation-for-two-strings.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [72. Edit Distance](en/1-1000/72-edit-distance.md) Python, Java, C++, JavaScript, C#, Go, Ruby. ### Hard Problems - [3494. Find the Minimum Amount of Time to Brew Potions](https://leetcodepython.com/en/leetcode/3494-find-the-minimum-amount-of-time-to-brew-potions) Python, Java, C++, JavaScript, C#, Go, Ruby. ## Monotonic Stack - [739. Daily Temperatures](en/1-1000/739-daily-temperatures.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [496. Next Greater Element I](en/1-1000/496-next-greater-element-i.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [42. Trapping Rain Water](en/1-1000/42-trapping-rain-water.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [84. Largest Rectangle in Histogram](en/1-1000/84-largest-rectangle-in-histogram.md) Python, Java, C++, JavaScript, C#, Go, Ruby. ## Graph Theory - [797. All Paths From Source to Target](en/1-1000/797-all-paths-from-source-to-target.md) Python, Java, C++, JavaScript, C#, Go, Ruby, **2** approaches. - [200. Number of Islands](en/1-1000/200-number-of-islands.md) Python, Java, C++, JavaScript, C#, Go, Ruby, **3** approaches. - [463. Island Perimeter](en/1-1000/463-island-perimeter.md) Python, **2** approaches. - [695. Max Area of Island](en/1-1000/695-max-area-of-island.md) Python, Java, C++, JavaScript, C#, Go, Ruby, **3** approaches. - [827. Making A Large Island](en/1-1000/827-making-a-large-island.md) Python, **2** approaches. - [127. Word Ladder](en/1-1000/127-word-ladder.md) Python. - [1971. Find if Path Exists in Graph](en/1001-2000/1971-find-if-path-exists-in-graph.md) Python, Java, C++, JavaScript, C#, Go, Ruby, 2 approaches. - [684. Redundant Connection](en/1-1000/684-redundant-connection.md) Python, Java, C++, JavaScript, C#, Go, Ruby. - [685. Redundant Connection II](en/1-1000/685-redundant-connection-ii.md) Python. - [1584. Min Cost to Connect All Points](en/1001-2000/1584-min-cost-to-connect-all-points.md) Python, Java, C++, JavaScript, C#, Go, Ruby, 2 approaches. - [207. Course Schedule](en/1-1000/207-course-schedule.md) Python, Java, C++, C#, 2 approaches. - [1514. Path with Maximum Probability](en/1001-2000/1514-path-with-maximum-probability.md) Python, 2 approaches. - [752. Open the Lock](en/1-1000/752-open-the-lock.md) Python, 2 approaches. - [743. Network Delay Time](en/1-1000/743-network-delay-time.md) Python, 2 approaches. - [787. Cheapest Flights Within K Stops](en/1-1000/787-cheapest-flights-within-k-stops.md) Python. - [1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance](en/1001-2000/1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.md) Python. ## Other Algorithms - [433. Minimum Genetic Mutation](en/1-1000/433-minimum-genetic-mutation.md) Python, 3 approaches. ## "Fuck LeetCode": More Problems More LeetCode problems and solutions will be added soon. Updated every day.