Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 3397. Maximum Number of Distinct Elements After Operations
Given nums and k, you may shift each element by any integer in [-k,k] at most once; maximize the number of distinct final values. This is equivalent to assigning each element a value inside its interval [num-k, num+k] to maximize distinct assignments — a greedy interval-assignment/packing problem.
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.