Leetcode-Solution icon indicating copy to clipboard operation
Leetcode-Solution copied to clipboard

My solutions in Python/CPP/Java with explanations in pictures for LeetCode problems.

LeetCodeSolution

For the latest contests, please refer to My Blog

LeetCode Contest

Weekly Contest 284

Weekly Contest 283

Biweekly Contest 73

Weekly Contest 281

Biweekly Contest 72

Weekly Contest 279

Biweekly Contest 71

Weekly Contest 277

Biweekly Contest 70

Weekly Contest 276

Weekly Contest 274

Weekly Contest 272

Weekly Contest 260

Biweekly Contest 61


My LeetCode Profile


Selected Leetcode Solutions with Pictures

1937. Maximum Number of Points with Cost

Fig.1 Fig.2 Fig.3

2025. Maximum Number of Ways to Partition an Array

Fig.1 Fig.2 Fig.3

1987. Number of Unique Good Subsequences

Fig.1 Fig.2 Fig.3

2019. The Score of Students Solving Math Expression

Fig.1 Fig.2 Fig.3

2009. Minimum Number of Operations to Make Array Continuous

Fig.1 Fig.2 Fig.3

1970. Last Day Where You Can Still Cross

1793. Maximum Score of a Good Subarray

1562. Find Latest Group of Size M

753. Cracking the Safe

1745. Palindrome Partitioning IV

857. Minimum Cost to Hire K Workers

1739. Building Boxes

1456. Maximum Number of Vowels in a Substring of Given Length

1820. Maximum Number of Accepted Invitations

2098. Subsequence of Size K With the Largest Even Sum

2102. Sequentially Ordinal Rank Tracker

2100. Find Good Days to Rob the Bank

2106. Maximum Fruits Harvested After at Most K Steps

2035. Partition Array Into Two Arrays to Minimize Sum Difference

2111. Minimum Operations to Make the Array K-Increasing

2110. Number of Smooth Descent Periods of a Stock

2127. Maximum Employees to Be Invited to a Meeting


All Solutions

1 - 500

501 - 1000

1001 - 1500

1501 - 2000

2001 - 2500


Discuss

KMP : https://leetcode.com/problems/longest-happy-prefix/discuss/1159846/Python-3-KMP-algorithm

1856 : https://leetcode.com/problems/maximum-subarray-min-product/discuss/1198704/python-3-explanation-with-picture-on-time

Trie : https://github.com/bakerston/LeetCodeSolution/blob/main/LeetCode/1-500/208.%20Implement%20Trie%20(Prefix%20Tree).md

Patching Array : https://leetcode.com/problems/patching-array/