File tree 1 file changed +0
-24
lines changed
src/main/java/com/fishercoder/solutions 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 390. Elimination Game
5
- *
6
- * There is a list of sorted integers from 1 to n.
7
- * Starting from left to right,
8
- * remove the first number and every other number afterward until you reach the end of the list.
9
- * Repeat the previous step again, but this time from right to left,
10
- * remove the right most number and every other number from the remaining numbers.
11
- * We keep repeating the steps again, alternating left to right and right to left, until a single number remains.
12
- * Find the last number that remains starting with a list of length n.
13
-
14
- Example:
15
-
16
- Input:
17
- n = 9,
18
- 1 2 3 4 5 6 7 8 9
19
- 2 4 6 8
20
- 2 6
21
- 6
22
-
23
- Output:
24
- 6
25
-
26
- */
27
3
public class _390 {
28
4
29
5
public static class Solution1 {
You can’t perform that action at this time.
0 commit comments