← All problemsSign in

2769. Find the Maximum Achievable Number

LeetCodeMathOpen on judge ↗

Given two integers, num and t. A number x is achievable if it can become equal to num after applying the following operation at most t times: - Increase or decrease x by 1, and simultaneously increase or decrease num by 1. Return the maximum possible value of x. Example 1: Input: num = 4, t = 1 Output: 6 Explanation: Apply the following operation once to make the maximum achievable number

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start