Leetcode 3347. Maximum Frequency of an Element After Performing Operations II
You can perform up to numOperations pointwise edits (each adding a value in [-k,k]) on distinct indices to make as many array entries equal as possible; the task is to pick a target value v and count how many elements already equal v plus up to numOperations others that can be moved to v (i.e., lie within ±k). With n up to 1e5 and values up to 1e9, the core challenge is efficiently evaluating interval coverage for candidate targets (via sorting/two-pointer or similar).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.