Skip to content

Commit 423ec13

Browse files
committed
2769: description update
1 parent 8e8f232 commit 423ec13

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

c-sharp/Problems/math/FindTheMaximumAchievableNumber.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
* Find the Maximum Achievable Number
44
**
55
* You are given two integers, num and t.
6-
* An integer x is called achievable if it can become equal to num after applying the following operation no more than t times:
7-
* Increase or decrease x by 1, and simultaneously increase or decrease num by 1.
6+
* An integer x is called achievable if it can become equal to num
7+
* after applying the following operation no more than t times:
8+
* Increase or decrease x by 1,
9+
* and simultaneously increase or decrease num by 1.
810
*
9-
* Return the maximum possible achievable number. It can be proven that there exists at least one achievable number.
11+
* Return the maximum possible achievable number.
12+
* It can be proven that there exists at least one achievable number.
1013
*
1114
* Example 1:
1215
* Input: num = 4, t = 1
1316
* Output: 6
1417
* Explanation:
15-
* The maximum achievable number is x = 6; it can become equal to num after performing this operation:
18+
* The maximum achievable number is x = 6;
19+
* it can become equal to num after performing this operation:
1620
* 1- Decrease x by 1, and increase num by 1. Now, x = 5 and num = 5.
1721
* It can be proven that there is no achievable number larger than 6.
1822
*
@@ -25,9 +29,12 @@
2529
* 2- Decrease x by 1, and increase num by 1. Now, x = 5 and num = 5.
2630
* It can be proven that there is no achievable number larger than 7.
2731
*
28-
* Constraints: 1 <= num, t <= 50
32+
* Constraints:
33+
* • 1 <= num, t <= 50
2934
*
30-
* Hint: Let x be the answer, it’s always optimal to decrease x in each operation and increase nums.
35+
* Hint:
36+
* Let x be the answer,
37+
* it’s always optimal to decrease x in each operation and increase nums.
3138
**
3239
* https://leetcode.com/problems/find-the-maximum-achievable-number/
3340
***/

0 commit comments

Comments
 (0)