File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .util .Arrays ;
4
4
5
- /**
6
- * 1033. Moving Stones Until Consecutive
7
- *
8
- * Three stones are on a number line at positions a, b, and c.
9
- *
10
- * Each turn, you pick up a stone at an endpoint (ie., either the lowest or highest position stone),
11
- * and move it to an unoccupied position between those endpoints.
12
- * Formally, let's say the stones are currently at positions x, y, z with x < y < z.
13
- * You pick up the stone at either position x or position z, and move that stone to an integer position k, with x < k < z and k != y.
14
- *
15
- * The game ends when you cannot make any more moves, ie. the stones are in consecutive positions.
16
- *
17
- * When the game ends, what is the minimum and maximum number of moves that you could have made?
18
- * Return the answer as an length 2 array: answer = [minimum_moves, maximum_moves]
19
- *
20
- * Note:
21
- * * 1 <= a <= 100
22
- * * 1 <= b <= 100
23
- * * 1 <= c <= 100
24
- * * a != b, b != c, c != a
25
- */
26
-
27
5
public class _1033 {
28
6
public static class Solution1 {
29
7
private int minMoves (int x , int y , int z ) {
You can’t perform that action at this time.
0 commit comments