You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/misc/leetcode.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
+++
2
2
title="Leetcode"
3
3
date=2025-03-24
4
-
updated = 2025-09-04
4
+
updated = 2025-10-24
5
5
taxonomies = { tags = ["Misc"] }
6
6
+++
7
7
@@ -29,6 +29,13 @@ Coding up brute force is a good starting point but a better starting point is ju
29
29
Add "digital" constraints like only looking at one variable at a time and then try to solve and see where you have repeated work and things like that which could cause the optimal solution to fall out.
30
30
In the example problem once I [looked at Deepti](https://www.youtube.com/watch?v=zraEXluZLj0) manually solve it, the solution became obvious and I wasn't stuck anymore.
31
31
32
+
-[424. Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement)
33
+
34
+
Also note where information you track gets used.
35
+
Is this example, [Neetcode](https://www.youtube.com/watch?v=gqXU1UyA8pk) was able to drop the constant 26 in the `O(26n)` down to 1 by tracking the max frequency.
36
+
This works (also explained in the video) because the only time we can increase the result is when we find a new max.
37
+
Before that it really doesn't matter, so having a max that is too high does not have negative side effects.
0 commit comments