Skip to content
  •  Soul Society
  •  0858#969#6261
  •  N/A
Dev Path for CC
  • About
  • Contact

Category: LeetCode

Solutions and Insights for LeetCode Problems

3404. Count Special Subsequences
LeetCode

3404. Count Special Subsequences

January 9, 2025 Hash Table, Math, Medium

Point: Turn multiplication to fraction Hard to realize “for r in range(4, n – 2): q = r – 2” part.

Leave a Comment on 3404. Count Special Subsequences
2168. Unique Substrings With Equal Digit Frequency
LeetCode

2168. Unique Substrings With Equal Digit Frequency

January 8, 2025 Hash Table, Medium, Rolling Hash

Actually, brute force can work due to constrains. However, if we count the frequency every time, the time complexity will be O(n**3), which may…

Leave a Comment on 2168. Unique Substrings With Equal Digit Frequency
1427. Perform String Shifts
LeetCode

1427. Perform String Shifts

January 8, 2025 Easy, Math, String

Don’t forget mod when dealing with shifting. A negative number a: a % b = (a + b) % b Anyway, easy makes me…

Leave a Comment on 1427. Perform String Shifts
3408. Design Task Manager
LeetCode

3408. Design Task Manager

January 7, 2025 Hash Table, Heap, Medium, OOD

Point is: we don’t have to remove items immediately from heap after rmv / edit operation. Do it when we are going to execTop.

Leave a Comment on 3408. Design Task Manager
3407. Substring Matching Pattern
LeetCode

3407. Substring Matching Pattern

January 7, 2025 Easy, String

This easy is easier than yesterday’s easy. New tech: str.find(sub) / str.rfind(sub). find the first/last index of sub. if sub == “”, return 0/n;…

Leave a Comment on 3407. Substring Matching Pattern
3409. Longest Subsequence With Decreasing Adjacent Difference
LeetCode

3409. Longest Subsequence With Decreasing Adjacent Difference

January 7, 2025 Dynamic Programming, Medium

1 Comment on 3409. Longest Subsequence With Decreasing Adjacent Difference
3413. Maximum Coins From K Consecutive Bags
LeetCode

3413. Maximum Coins From K Consecutive Bags

January 7, 2025 Medium, Sliding Window

1 Comment on 3413. Maximum Coins From K Consecutive Bags
3412. Find Mirror Score of a String
LeetCode

3412. Find Mirror Score of a String

January 7, 2025January 7, 2025 Hash Table, Medium

Leave a Comment on 3412. Find Mirror Score of a String
3411. Maximum Subarray With Equal Products
LeetCode

3411. Maximum Subarray With Equal Products

January 6, 2025January 6, 2025 Easy, Math, Sliding Window

You are given an array of positive integers nums. An array arr is called product equivalent if prod(arr) == lcm(arr) * gcd(arr), where: prod(arr)…

1 Comment on 3411. Maximum Subarray With Equal Products

Posts pagination

« 1 2 3 4

Recent Posts

  • 🚨 Welcome to the Era of o4: Powerful, Autonomous… and Hallucinating?
  • 3472. Longest Palindromic Subsequence After at Most K Operations
  • 3473. Sum of K Subarrays With Length at Least M
  • 3474. Lexicographically Smallest Generated String
  • 1524. Number of Sub-arrays With Odd Sum

Recent Comments

  1. lcsqr on 1462. Course Schedule IV
  2. lcsqr on 1462. Course Schedule IV
  3. lcsqr on 3409. Longest Subsequence With Decreasing Adjacent Difference
  4. lcsqr on 3413. Maximum Coins From K Consecutive Bags
  5. lcsqr on 3411. Maximum Subarray With Equal Products

Archives

  • April 2025
  • March 2025
  • February 2025
  • January 2025

Categories

  • Artificial Intelligence
  • LeetCode
  • Others
Designed by Nasio Themes || Powered by WordPress