|
2 | 2 |
|
3 | 3 | importjava.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 | publicclass_1033 {
|
28 | 6 | publicstaticclassSolution1 {
|
29 | 7 | privateintminMoves(intx,inty,intz) {
|
|