Problem
Problem Source: NowCoder Online Test
Given an array $nums$ indexing from $0$ and a non-negative integer $k$.
In one operation, you can perform the following:
- Choose an index $i$ not chosen before, where $i$ is in the range $[0, nums.length - 1]$.
- Replace $nums[i]$ with any integer in the range $[nums[i] - k, nums[i] + k]$ (inclusive).
After applying any times of operations, return the maximum possible score of the array $nums$.
The array's score is defined as the "maximum number of repeated elements in the array".
Note that you can only apply the operation once for each index.