2769. Find the Maximum Achievable Number
You are given two integers,
num
andt
.An integer
x
is called achievable if it can become equal tonum
after applying the following operation no more thant
times:
- Increase or decrease
x
by1
, and simultaneously increase or decreasenum
by1
.Return the maximum possible achievable number. It can be proven that there exists at least one achievable number.
1 | class Solution { |