From 0908a0964493f2b7ae2a13647d3faa599ad2af12 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 9 Sep 2024 22:49:20 +0300 Subject: [PATCH 1/4] Added tasks 3280-3283 --- .../Solution.java | 19 +++++ .../s3280_convert_date_to_binary/readme.md | 35 ++++++++ .../Solution.java | 34 ++++++++ .../readme.md | 35 ++++++++ .../Solution.java | 17 ++++ .../readme.md | 36 ++++++++ .../Solution.java | 84 +++++++++++++++++++ .../readme.md | 64 ++++++++++++++ .../SolutionTest.java | 19 +++++ .../SolutionTest.java | 18 ++++ .../SolutionTest.java | 19 +++++ .../SolutionTest.java | 23 +++++ 12 files changed, 403 insertions(+) create mode 100644 src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java create mode 100644 src/main/java/g3201_3300/s3280_convert_date_to_binary/readme.md create mode 100644 src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java create mode 100644 src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/readme.md create mode 100644 src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java create mode 100644 src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/readme.md create mode 100644 src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java create mode 100644 src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/readme.md create mode 100644 src/test/java/g3201_3300/s3280_convert_date_to_binary/SolutionTest.java create mode 100644 src/test/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.java create mode 100644 src/test/java/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.java create mode 100644 src/test/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.java diff --git a/src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java b/src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java new file mode 100644 index 000000000..5cb240468 --- /dev/null +++ b/src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java @@ -0,0 +1,19 @@ +package g3201_3300.s3280_convert_date_to_binary; + +// #Easy #2024_09_09_Time_3_ms_(100.00%)_Space_42.4_MB_(50.00%) + +public class Solution { + private String helper(String str) { + return Integer.toBinaryString(Integer.parseInt(str)); + } + + public String convertDateToBinary(String date) { + StringBuilder sb = new StringBuilder(); + for (String str : date.split("-")) { + sb.append(helper(str)); + sb.append("-"); + } + sb.deleteCharAt(sb.length() - 1); + return sb.toString(); + } +} diff --git a/src/main/java/g3201_3300/s3280_convert_date_to_binary/readme.md b/src/main/java/g3201_3300/s3280_convert_date_to_binary/readme.md new file mode 100644 index 000000000..64ba96f9a --- /dev/null +++ b/src/main/java/g3201_3300/s3280_convert_date_to_binary/readme.md @@ -0,0 +1,35 @@ +3280\. Convert Date to Binary + +Easy + +You are given a string `date` representing a Gregorian calendar date in the `yyyy-mm-dd` format. + +`date` can be written in its binary representation obtained by converting year, month, and day to their binary representations without any leading zeroes and writing them down in `year-month-day` format. + +Return the **binary** representation of `date`. + +**Example 1:** + +**Input:** date = "2080-02-29" + +**Output:** "100000100000-10-11101" + +**Explanation:** + +100000100000, 10, and 11101 are the binary representations of 2080, 02, and 29 respectively. + +**Example 2:** + +**Input:** date = "1900-01-01" + +**Output:** "11101101100-1-1" + +**Explanation:** + +11101101100, 1, and 1 are the binary representations of 1900, 1, and 1 respectively. + +**Constraints:** + +* `date.length == 10` +* `date[4] == date[7] == '-'`, and all other `date[i]`'s are digits. +* The input is generated such that `date` represents a valid Gregorian calendar date between Jan 1st, 1900 and Dec 31st, 2100 (both inclusive). \ No newline at end of file diff --git a/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java b/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java new file mode 100644 index 000000000..dd565d69a --- /dev/null +++ b/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java @@ -0,0 +1,34 @@ +package g3201_3300.s3281_maximize_score_of_numbers_in_ranges; + +// #Medium #2024_09_09_Time_47_ms_(100.00%)_Space_58.3_MB_(100.00%) + +import java.util.Arrays; + +public class Solution { + public int maxPossibleScore(int[] start, int d) { + Arrays.sort(start); + int n = start.length; + int l = 0; + int r = start[n - 1] - start[0] + d + 1; + while (l < r) { + int m = l + (r - l) / 2; + if (isPossible(start, d, m)) { + l = m + 1; + } else { + r = m; + } + } + return l - 1; + } + + private boolean isPossible(int[] start, int d, int score) { + int pre = start[0]; + for (int i = 1; i < start.length; i++) { + if (start[i] + d - pre < score) { + return false; + } + pre = Math.max(start[i], pre + score); + } + return true; + } +} diff --git a/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/readme.md b/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/readme.md new file mode 100644 index 000000000..547db6de9 --- /dev/null +++ b/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/readme.md @@ -0,0 +1,35 @@ +3281\. Maximize Score of Numbers in Ranges + +Medium + +You are given an array of integers `start` and an integer `d`, representing `n` intervals `[start[i], start[i] + d]`. + +You are asked to choose `n` integers where the ith integer must belong to the ith interval. The **score** of the chosen integers is defined as the **minimum** absolute difference between any two integers that have been chosen. + +Return the **maximum** _possible score_ of the chosen integers. + +**Example 1:** + +**Input:** start = [6,0,3], d = 2 + +**Output:** 4 + +**Explanation:** + +The maximum possible score can be obtained by choosing integers: 8, 0, and 4. The score of these chosen integers is `min(|8 - 0|, |8 - 4|, |0 - 4|)` which equals 4. + +**Example 2:** + +**Input:** start = [2,6,13,13], d = 5 + +**Output:** 5 + +**Explanation:** + +The maximum possible score can be obtained by choosing integers: 2, 7, 13, and 18. The score of these chosen integers is `min(|2 - 7|, |2 - 13|, |2 - 18|, |7 - 13|, |7 - 18|, |13 - 18|)` which equals 5. + +**Constraints:** + +* 2 <= start.length <= 105 +* 0 <= start[i] <= 109 +* 0 <= d <= 109 \ No newline at end of file diff --git a/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java b/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java new file mode 100644 index 000000000..4f18b3ffd --- /dev/null +++ b/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java @@ -0,0 +1,17 @@ +package g3201_3300.s3282_reach_end_of_array_with_max_score; + +// #Medium #2024_09_09_Time_9_ms_(100.00%)_Space_63.2_MB_(100.00%) + +import java.util.List; + +public class Solution { + public long findMaximumScore(List nums) { + long res = 0; + long ma = 0; + for (int num : nums) { + res += ma; + ma = Math.max(ma, num); + } + return res; + } +} diff --git a/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/readme.md b/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/readme.md new file mode 100644 index 000000000..c20c31408 --- /dev/null +++ b/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/readme.md @@ -0,0 +1,36 @@ +3282\. Reach End of Array With Max Score + +Medium + +You are given an integer array `nums` of length `n`. + +Your goal is to start at index `0` and reach index `n - 1`. You can only jump to indices **greater** than your current index. + +The score for a jump from index `i` to index `j` is calculated as `(j - i) * nums[i]`. + +Return the **maximum** possible **total score** by the time you reach the last index. + +**Example 1:** + +**Input:** nums = [1,3,1,5] + +**Output:** 7 + +**Explanation:** + +First, jump to index 1 and then jump to the last index. The final score is `1 * 1 + 2 * 3 = 7`. + +**Example 2:** + +**Input:** nums = [4,3,1,3,2] + +**Output:** 16 + +**Explanation:** + +Jump directly to the last index. The final score is `4 * 4 = 16`. + +**Constraints:** + +* 1 <= nums.length <= 105 +* 1 <= nums[i] <= 105 \ No newline at end of file diff --git a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java new file mode 100644 index 000000000..e822a7291 --- /dev/null +++ b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java @@ -0,0 +1,84 @@ +package g3201_3300.s3283_maximum_number_of_moves_to_kill_all_pawns; + +// #Hard #2024_09_09_Time_250_ms_(98.43%)_Space_50.1_MB_(66.27%) + +import java.util.LinkedList; +import java.util.Queue; + +public class Solution { + private static final int[][] KNIGHT_MOVES = { + {-2, -1}, {-2, 1}, {-1, -2}, {-1, 2}, + {1, -2}, {1, 2}, {2, -1}, {2, 1} + }; + private int[][] distances; + private Integer[][] memo; + + public int maxMoves(int kx, int ky, int[][] positions) { + int n = positions.length; + distances = new int[n + 1][n + 1]; + memo = new Integer[n + 1][1 << n]; + // Calculate distances between all pairs of positions (including knight's initial position) + for (int i = 0; i < n; i++) { + distances[n][i] = calculateMoves(kx, ky, positions[i][0], positions[i][1]); + for (int j = i + 1; j < n; j++) { + int dist = + calculateMoves( + positions[i][0], positions[i][1], positions[j][0], positions[j][1]); + distances[i][j] = distances[j][i] = dist; + } + } + return minimax(n, (1 << n) - 1, true); + } + + private int minimax(int lastPos, int remainingPawns, boolean isAlice) { + if (remainingPawns == 0) { + return 0; + } + if (memo[lastPos][remainingPawns] != null) { + return memo[lastPos][remainingPawns]; + } + int result = isAlice ? 0 : Integer.MAX_VALUE; + for (int i = 0; i < distances.length - 1; i++) { + if ((remainingPawns & (1 << i)) != 0) { + int newRemainingPawns = remainingPawns & ~(1 << i); + int moveValue = distances[lastPos][i] + minimax(i, newRemainingPawns, !isAlice); + + if (isAlice) { + result = Math.max(result, moveValue); + } else { + result = Math.min(result, moveValue); + } + } + } + memo[lastPos][remainingPawns] = result; + return result; + } + + private int calculateMoves(int x1, int y1, int x2, int y2) { + if (x1 == x2 && y1 == y2) { + return 0; + } + boolean[][] visited = new boolean[50][50]; + Queue queue = new LinkedList<>(); + queue.offer(new int[] {x1, y1, 0}); + visited[x1][y1] = true; + while (!queue.isEmpty()) { + int[] current = queue.poll(); + int x = current[0]; + int y = current[1]; + int moves = current[2]; + for (int[] move : KNIGHT_MOVES) { + int nx = x + move[0], ny = y + move[1]; + if (nx == x2 && ny == y2) { + return moves + 1; + } + if (nx >= 0 && nx < 50 && ny >= 0 && ny < 50 && !visited[nx][ny]) { + queue.offer(new int[] {nx, ny, moves + 1}); + visited[nx][ny] = true; + } + } + } + // Should never reach here if input is valid + return -1; + } +} diff --git a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/readme.md b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/readme.md new file mode 100644 index 000000000..67ab70621 --- /dev/null +++ b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/readme.md @@ -0,0 +1,64 @@ +3283\. Maximum Number of Moves to Kill All Pawns + +Hard + +There is a `50 x 50` chessboard with **one** knight and some pawns on it. You are given two integers `kx` and `ky` where `(kx, ky)` denotes the position of the knight, and a 2D array `positions` where positions[i] = [xi, yi] denotes the position of the pawns on the chessboard. + +Alice and Bob play a _turn-based_ game, where Alice goes first. In each player's turn: + +* The player _selects_ a pawn that still exists on the board and captures it with the knight in the **fewest** possible **moves**. **Note** that the player can select **any** pawn, it **might not** be one that can be captured in the **least** number of moves. +* In the process of capturing the _selected_ pawn, the knight **may** pass other pawns **without** capturing them. **Only** the _selected_ pawn can be captured in _this_ turn. + +Alice is trying to **maximize** the **sum** of the number of moves made by _both_ players until there are no more pawns on the board, whereas Bob tries to **minimize** them. + +Return the **maximum** _total_ number of moves made during the game that Alice can achieve, assuming both players play **optimally**. + +Note that in one **move,** a chess knight has eight possible positions it can move to, as illustrated below. Each move is two cells in a cardinal direction, then one cell in an orthogonal direction. + +![](https://assets.leetcode.com/uploads/2024/08/01/chess_knight.jpg) + +**Example 1:** + +**Input:** kx = 1, ky = 1, positions = [[0,0]] + +**Output:** 4 + +**Explanation:** + +![](https://assets.leetcode.com/uploads/2024/08/16/gif3.gif) + +The knight takes 4 moves to reach the pawn at `(0, 0)`. + +**Example 2:** + +**Input:** kx = 0, ky = 2, positions = [[1,1],[2,2],[3,3]] + +**Output:** 8 + +**Explanation:** + +**![](https://assets.leetcode.com/uploads/2024/08/16/gif4.gif)** + +* Alice picks the pawn at `(2, 2)` and captures it in two moves: `(0, 2) -> (1, 4) -> (2, 2)`. +* Bob picks the pawn at `(3, 3)` and captures it in two moves: `(2, 2) -> (4, 1) -> (3, 3)`. +* Alice picks the pawn at `(1, 1)` and captures it in four moves: `(3, 3) -> (4, 1) -> (2, 2) -> (0, 3) -> (1, 1)`. + +**Example 3:** + +**Input:** kx = 0, ky = 0, positions = [[1,2],[2,4]] + +**Output:** 3 + +**Explanation:** + +* Alice picks the pawn at `(2, 4)` and captures it in two moves: `(0, 0) -> (1, 2) -> (2, 4)`. Note that the pawn at `(1, 2)` is not captured. +* Bob picks the pawn at `(1, 2)` and captures it in one move: `(2, 4) -> (1, 2)`. + +**Constraints:** + +* `0 <= kx, ky <= 49` +* `1 <= positions.length <= 15` +* `positions[i].length == 2` +* `0 <= positions[i][0], positions[i][1] <= 49` +* All `positions[i]` are unique. +* The input is generated such that `positions[i] != [kx, ky]` for all `0 <= i < positions.length`. \ No newline at end of file diff --git a/src/test/java/g3201_3300/s3280_convert_date_to_binary/SolutionTest.java b/src/test/java/g3201_3300/s3280_convert_date_to_binary/SolutionTest.java new file mode 100644 index 000000000..b50b9c390 --- /dev/null +++ b/src/test/java/g3201_3300/s3280_convert_date_to_binary/SolutionTest.java @@ -0,0 +1,19 @@ +package g3201_3300.s3280_convert_date_to_binary; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.jupiter.api.Test; + +class SolutionTest { + @Test + void convertDateToBinary() { + assertThat( + new Solution().convertDateToBinary("2080-02-29"), equalTo("100000100000-10-11101")); + } + + @Test + void convertDateToBinary2() { + assertThat(new Solution().convertDateToBinary("1900-01-01"), equalTo("11101101100-1-1")); + } +} diff --git a/src/test/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.java b/src/test/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.java new file mode 100644 index 000000000..7dfab6811 --- /dev/null +++ b/src/test/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.java @@ -0,0 +1,18 @@ +package g3201_3300.s3281_maximize_score_of_numbers_in_ranges; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.jupiter.api.Test; + +class SolutionTest { + @Test + void maxPossibleScore() { + assertThat(new Solution().maxPossibleScore(new int[] {6, 0, 3}, 2), equalTo(4)); + } + + @Test + void maxPossibleScore2() { + assertThat(new Solution().maxPossibleScore(new int[] {2, 6, 13, 13}, 5), equalTo(5)); + } +} diff --git a/src/test/java/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.java b/src/test/java/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.java new file mode 100644 index 000000000..de2f6cdc6 --- /dev/null +++ b/src/test/java/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.java @@ -0,0 +1,19 @@ +package g3201_3300.s3282_reach_end_of_array_with_max_score; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.util.List; +import org.junit.jupiter.api.Test; + +class SolutionTest { + @Test + void findMaximumScore() { + assertThat(new Solution().findMaximumScore(List.of(1, 3, 1, 5)), equalTo(7L)); + } + + @Test + void findMaximumScore2() { + assertThat(new Solution().findMaximumScore(List.of(4, 3, 1, 3, 2)), equalTo(16L)); + } +} diff --git a/src/test/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.java b/src/test/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.java new file mode 100644 index 000000000..547e0d076 --- /dev/null +++ b/src/test/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.java @@ -0,0 +1,23 @@ +package g3201_3300.s3283_maximum_number_of_moves_to_kill_all_pawns; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.jupiter.api.Test; + +class SolutionTest { + @Test + void maxMoves() { + assertThat(new Solution().maxMoves(1, 1, new int[][] {{0, 0}}), equalTo(4)); + } + + @Test + void maxMoves2() { + assertThat(new Solution().maxMoves(0, 2, new int[][] {{1, 1}, {2, 2}, {3, 3}}), equalTo(8)); + } + + @Test + void maxMoves3() { + assertThat(new Solution().maxMoves(0, 0, new int[][] {{1, 2}, {2, 4}}), equalTo(3)); + } +} From e55ac23f9101455b78966bd6722bdf7d38f7913f Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 9 Sep 2024 22:51:57 +0300 Subject: [PATCH 2/4] Fixed style --- .../Solution.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java index e822a7291..02ab347ba 100644 --- a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java +++ b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java @@ -68,7 +68,8 @@ private int calculateMoves(int x1, int y1, int x2, int y2) { int y = current[1]; int moves = current[2]; for (int[] move : KNIGHT_MOVES) { - int nx = x + move[0], ny = y + move[1]; + int nx = x + move[0]; + int ny = y + move[1]; if (nx == x2 && ny == y2) { return moves + 1; } From 294bcd0cc69862b12a0546d2a121354d8a208f8e Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 10 Sep 2024 05:25:19 +0300 Subject: [PATCH 3/4] Updated tags --- .../java/g3201_3300/s3280_convert_date_to_binary/Solution.java | 2 +- .../s3281_maximize_score_of_numbers_in_ranges/Solution.java | 3 ++- .../s3282_reach_end_of_array_with_max_score/Solution.java | 2 +- .../Solution.java | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java b/src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java index 5cb240468..6b69aaf27 100644 --- a/src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java +++ b/src/main/java/g3201_3300/s3280_convert_date_to_binary/Solution.java @@ -1,6 +1,6 @@ package g3201_3300.s3280_convert_date_to_binary; -// #Easy #2024_09_09_Time_3_ms_(100.00%)_Space_42.4_MB_(50.00%) +// #Easy #String #Math #2024_09_09_Time_3_ms_(100.00%)_Space_42.4_MB_(50.00%) public class Solution { private String helper(String str) { diff --git a/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java b/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java index dd565d69a..f7a972d0f 100644 --- a/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java +++ b/src/main/java/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/Solution.java @@ -1,6 +1,7 @@ package g3201_3300.s3281_maximize_score_of_numbers_in_ranges; -// #Medium #2024_09_09_Time_47_ms_(100.00%)_Space_58.3_MB_(100.00%) +// #Medium #Array #Sorting #Greedy #Binary_Search +// #2024_09_09_Time_47_ms_(100.00%)_Space_58.3_MB_(100.00%) import java.util.Arrays; diff --git a/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java b/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java index 4f18b3ffd..1d24967b3 100644 --- a/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java +++ b/src/main/java/g3201_3300/s3282_reach_end_of_array_with_max_score/Solution.java @@ -1,6 +1,6 @@ package g3201_3300.s3282_reach_end_of_array_with_max_score; -// #Medium #2024_09_09_Time_9_ms_(100.00%)_Space_63.2_MB_(100.00%) +// #Medium #Array #Greedy #2024_09_09_Time_9_ms_(100.00%)_Space_63.2_MB_(100.00%) import java.util.List; diff --git a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java index 02ab347ba..8363652d1 100644 --- a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java +++ b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java @@ -1,6 +1,7 @@ package g3201_3300.s3283_maximum_number_of_moves_to_kill_all_pawns; -// #Hard #2024_09_09_Time_250_ms_(98.43%)_Space_50.1_MB_(66.27%) +// #Hard #Array #Math #Bit_Manipulation #Bitmask #Game_Theory #Breadth_First_Search +// #2024_09_09_Time_250_ms_(98.43%)_Space_50.1_MB_(66.27%) import java.util.LinkedList; import java.util.Queue; From 3f6b201d08cb9ad78f22c95eaf21b39de1b6d716 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 10 Sep 2024 05:28:21 +0300 Subject: [PATCH 4/4] Improved tags --- .../Solution.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java index 8363652d1..d971640a3 100644 --- a/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java +++ b/src/main/java/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/Solution.java @@ -1,6 +1,6 @@ package g3201_3300.s3283_maximum_number_of_moves_to_kill_all_pawns; -// #Hard #Array #Math #Bit_Manipulation #Bitmask #Game_Theory #Breadth_First_Search +// #Hard #Array #Math #Breadth_First_Search #Bit_Manipulation #Bitmask #Game_Theory // #2024_09_09_Time_250_ms_(98.43%)_Space_50.1_MB_(66.27%) import java.util.LinkedList;