← ALL NOTES
Array

3397. Maximum Number of Distinct Elements After Operations

Given an array nums and a number k. Each element can be changed once to any value in [nums[i]−k, nums[i]+k]. Find the maximum number of distinct values in the resulting array.

Loading…