You are given a nums and a non negative integer k.
In one operation, you can:
Choose any index i that has not been chosen previously.
Replace nums[i] with any integer from the range nums[i] k, nums[i] k
The beauty of the array is defined as the length of the longest subsequence consisting of equal elements.
Return the maximum possible beauty of nums after applying the operation any number of times.
Note: You can apply the operation to each index at most
time.
Constraints:
nums.length
nums[i], k
You are given a nums and a non negative integer k.
In one operation, you can:
Choose any index i that has not been chosen previously.
Replace nums[i] with any integer from the range nums[i] k, nums[i] k
The beauty of the array is defined as the length of the longest subsequence consisting of equal elements.
Return the maximum possible beauty of nums after applying the operation any number of times.
Note: You can apply the operation to each index at most
time.
Constraints:
nums.length
nums[i], k