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:
Return the maximum possible value of x.
Examples
Example 1
Input: num = 4, t = 1
Output: 6
Explanation:
Apply the following operation once to make the maximum achievable number equal to num :
Example 2
Input: num = 3, t = 2
Output: 7
Explanation:
Apply the following operation twice to make the maximum achievable number equal to num :
Constraints
1 <= num, t <= 50
2769. Find the Maximum Achievable Number
Easy
10 Points
Math
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:
Return the maximum possible value of x.
Examples
Example 1
Input: num = 4, t = 1
Output: 6
Explanation:
Apply the following operation once to make the maximum achievable number equal to num :
Example 2
Input: num = 3, t = 2
Output: 7
Explanation:
Apply the following operation twice to make the maximum achievable number equal to num :
Constraints
1 <= num, t <= 50
Find the Maximum Achievable Number - Practice Coding | SlaveCode