Skip to content

Commit 4461047

Browse files
refactor 464
1 parent bc2b3aa commit 4461047

File tree

1 file changed

+0
-26
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-26
lines changed

src/main/java/com/fishercoder/solutions/_464.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,6 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
/**
7-
* 464. Can I Win
8-
*
9-
* In the "100 game," two players take turns adding, to a running total, any integer from 1..10.
10-
* The player who first causes the running total to reach or exceed 100 wins.
11-
* What if we change the game so that players cannot re-use integers?
12-
* For example, two players might take turns drawing from a common pool of numbers of 1..15 without replacement until they reach a total >= 100.
13-
* Given an integer maxChoosableInteger and another integer desiredTotal, determine if the first player to move can force a win, assuming both players play optimally.
14-
*You can always assume that maxChoosableInteger will not be larger than 20 and desiredTotal will not be larger than 300.
15-
16-
Example
17-
18-
Input:
19-
maxChoosableInteger = 10
20-
desiredTotal = 11
21-
22-
Output:
23-
false
24-
25-
Explanation:
26-
No matter which integer the first player choose, the first player will lose.
27-
The first player can choose an integer from 1 up to 10.
28-
If the first player choose 1, the second player can only choose integers from 2 up to 10.
29-
The second player will win by choosing 10 and get a total = 11, which is >= desiredTotal.
30-
Same with other integers chosen by the first player, the second player will always win.
31-
*/
326
public class _464 {
337
public static class Solution1 {
348
/**

0 commit comments

Comments
 (0)