[코테 풀이] Find the Maximum Achievable Number

시내·2024년 6월 10일
0

Q_2769) Find the Maximum Achievable Number

출처 : https://leetcode.com/problems/find-the-maximum-achievable-number/

Given two integers, num and t. A number is achievable if it can become equal to num after applying the following operation:

Increase or decrease the number by 1, and simultaneously increase or decrease num by 1.
Return the maximum achievable number after applying the operation at most t times.

class Solution {
    public int theMaximumAchievableX(int num, int t) {
        return num + 2*t;
    }
}
profile
contact 📨 ksw08215@gmail.com

0개의 댓글

관련 채용 정보