3397. Maximum Number of Distinct Elements After Operations
You are given an integer array
numsand an integerk.You are allowed to perform the following operation on each element of the array at most once:
- Add an integer in the range
[-k, k]to the element.Return the maximum possible number of distinct elements in
numsafter performing the operations.
1 | class Solution { |