Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2841. Maximum Sum of Almost Unique Subarray
Find the maximum sum of any contiguous subarray of length k that contains at least m distinct elements (return 0 if none). This is a sliding-window problem where you maintain the window sum and a frequency map to track distinct counts efficiently.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.