Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7847abe

Browse files
refactor 1033
1 parenta308079 commit7847abe

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

‎src/main/java/com/fishercoder/solutions/_1033.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,6 @@
22

33
importjava.util.Arrays;
44

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-
275
publicclass_1033 {
286
publicstaticclassSolution1 {
297
privateintminMoves(intx,inty,intz) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp