2769. Find the Maximum Achievable Number
You are given two integers,
numandt.An integer
xis called achievable if it can become equal tonumafter applying the following operation no more thanttimes:
- Increase or decrease
xby1, and simultaneously increase or decreasenumby1.Return the maximum possible achievable number. It can be proven that there exists at least one achievable number.
1 | class Solution { |