Maximize Consecutive Elements in an Array After Modification
Sort the values, then track the longest consecutive run ending at each value, allowing each element to stay or grow by 1.
Sort the values, then track the longest consecutive run ending at each value, allowing each element to stay or grow by 1.