diff --git a/src/main/java/g3201_3300/s3206_alternating_groups_i/Solution.java b/src/main/java/g3201_3300/s3206_alternating_groups_i/Solution.java
new file mode 100644
index 000000000..a76eb3404
--- /dev/null
+++ b/src/main/java/g3201_3300/s3206_alternating_groups_i/Solution.java
@@ -0,0 +1,22 @@
+package g3201_3300.s3206_alternating_groups_i;
+
+// #Easy #Array #Sliding_Window #2024_07_09_Time_1_ms_(97.24%)_Space_42.8_MB_(90.31%)
+
+public class Solution {
+ public int numberOfAlternatingGroups(int[] colors) {
+ int n = colors.length;
+ int count = 0;
+ if (colors[n - 1] != colors[0] && colors[0] != colors[1]) {
+ count++;
+ }
+ if (colors[n - 1] != colors[0] && colors[n - 1] != colors[n - 2]) {
+ count++;
+ }
+ for (int i = 1; i < n - 1; i++) {
+ if (colors[i] != colors[i - 1] && colors[i] != colors[i + 1]) {
+ count++;
+ }
+ }
+ return count;
+ }
+}
diff --git a/src/main/java/g3201_3300/s3206_alternating_groups_i/readme.md b/src/main/java/g3201_3300/s3206_alternating_groups_i/readme.md
new file mode 100644
index 000000000..03dec61d4
--- /dev/null
+++ b/src/main/java/g3201_3300/s3206_alternating_groups_i/readme.md
@@ -0,0 +1,43 @@
+3206\. Alternating Groups I
+
+Easy
+
+There is a circle of red and blue tiles. You are given an array of integers `colors`. The color of tile `i` is represented by `colors[i]`:
+
+* `colors[i] == 0` means that tile `i` is **red**.
+* `colors[i] == 1` means that tile `i` is **blue**.
+
+Every 3 contiguous tiles in the circle with **alternating** colors (the middle tile has a different color from its **left** and **right** tiles) is called an **alternating** group.
+
+Return the number of **alternating** groups.
+
+**Note** that since `colors` represents a **circle**, the **first** and the **last** tiles are considered to be next to each other.
+
+**Example 1:**
+
+**Input:** colors = [1,1,1]
+
+**Output:** 0
+
+**Explanation:**
+
+
+
+**Example 2:**
+
+**Input:** colors = [0,1,0,0,1]
+
+**Output:** 3
+
+**Explanation:**
+
+
+
+Alternating groups:
+
+********
+
+**Constraints:**
+
+* `3 <= colors.length <= 100`
+* `0 <= colors[i] <= 1`
\ No newline at end of file
diff --git a/src/main/java/g3201_3300/s3207_maximum_points_after_enemy_battles/Solution.java b/src/main/java/g3201_3300/s3207_maximum_points_after_enemy_battles/Solution.java
new file mode 100644
index 000000000..2033b68b9
--- /dev/null
+++ b/src/main/java/g3201_3300/s3207_maximum_points_after_enemy_battles/Solution.java
@@ -0,0 +1,22 @@
+package g3201_3300.s3207_maximum_points_after_enemy_battles;
+
+// #Medium #Array #Greedy #2024_07_09_Time_1_ms_(100.00%)_Space_55.5_MB_(99.34%)
+
+public class Solution {
+ public long maximumPoints(int[] enemyEnergies, int currentEnergy) {
+ int n = enemyEnergies.length;
+ int min = enemyEnergies[0];
+ for (int i = 1; i < n; i++) {
+ min = Math.min(min, enemyEnergies[i]);
+ }
+ if (currentEnergy == 0 || currentEnergy < min) {
+ return 0;
+ }
+ long sum = currentEnergy;
+ for (int i = n - 1; i >= 0; i--) {
+ sum += enemyEnergies[i];
+ }
+ sum -= min;
+ return sum / min;
+ }
+}
diff --git a/src/main/java/g3201_3300/s3207_maximum_points_after_enemy_battles/readme.md b/src/main/java/g3201_3300/s3207_maximum_points_after_enemy_battles/readme.md
new file mode 100644
index 000000000..694783a8a
--- /dev/null
+++ b/src/main/java/g3201_3300/s3207_maximum_points_after_enemy_battles/readme.md
@@ -0,0 +1,52 @@
+3207\. Maximum Points After Enemy Battles
+
+Medium
+
+You are given an integer array `enemyEnergies` denoting the energy values of various enemies.
+
+You are also given an integer `currentEnergy` denoting the amount of energy you have initially.
+
+You start with 0 points, and all the enemies are unmarked initially.
+
+You can perform **either** of the following operations **zero** or multiple times to gain points:
+
+* Choose an **unmarked** enemy, `i`, such that `currentEnergy >= enemyEnergies[i]`. By choosing this option:
+ * You gain 1 point.
+ * Your energy is reduced by the enemy's energy, i.e. `currentEnergy = currentEnergy - enemyEnergies[i]`.
+* If you have **at least** 1 point, you can choose an **unmarked** enemy, `i`. By choosing this option:
+ * Your energy increases by the enemy's energy, i.e. `currentEnergy = currentEnergy + enemyEnergies[i]`.
+ * The enemy `i` is **marked**.
+
+Return an integer denoting the **maximum** points you can get in the end by optimally performing operations.
+
+**Example 1:**
+
+**Input:** enemyEnergies = [3,2,2], currentEnergy = 2
+
+**Output:** 3
+
+**Explanation:**
+
+The following operations can be performed to get 3 points, which is the maximum:
+
+* First operation on enemy 1: `points` increases by 1, and `currentEnergy` decreases by 2. So, `points = 1`, and `currentEnergy = 0`.
+* Second operation on enemy 0: `currentEnergy` increases by 3, and enemy 0 is marked. So, `points = 1`, `currentEnergy = 3`, and marked enemies = `[0]`.
+* First operation on enemy 2: `points` increases by 1, and `currentEnergy` decreases by 2. So, `points = 2`, `currentEnergy = 1`, and marked enemies = `[0]`.
+* Second operation on enemy 2: `currentEnergy` increases by 2, and enemy 2 is marked. So, `points = 2`, `currentEnergy = 3`, and marked enemies = `[0, 2]`.
+* First operation on enemy 1: `points` increases by 1, and `currentEnergy` decreases by 2. So, `points = 3`, `currentEnergy = 1`, and marked enemies = `[0, 2]`.
+
+**Example 2:**
+
+**Input:** enemyEnergies = [2], currentEnergy = 10
+
+**Output:** 5
+
+**Explanation:**
+
+Performing the first operation 5 times on enemy 0 results in the maximum number of points.
+
+**Constraints:**
+
+* 1 <= enemyEnergies.length <= 105
+* 1 <= enemyEnergies[i] <= 109
+* 0 <= currentEnergy <= 109
\ No newline at end of file
diff --git a/src/main/java/g3201_3300/s3208_alternating_groups_ii/Solution.java b/src/main/java/g3201_3300/s3208_alternating_groups_ii/Solution.java
new file mode 100644
index 000000000..36fd609e5
--- /dev/null
+++ b/src/main/java/g3201_3300/s3208_alternating_groups_ii/Solution.java
@@ -0,0 +1,44 @@
+package g3201_3300.s3208_alternating_groups_ii;
+
+// #Medium #Array #Sliding_Window #2024_07_09_Time_2_ms_(99.02%)_Space_63.3_MB_(22.96%)
+
+public class Solution {
+ public int numberOfAlternatingGroups(int[] colors, int k) {
+ int i = 0;
+ int len = 0;
+ int total = 0;
+ while (i < colors.length - 1) {
+ int j = i + 1;
+ if (colors[j] != colors[i]) {
+ len = 2;
+ j++;
+ while (j < colors.length && colors[j] != colors[j - 1]) {
+ j++;
+ len++;
+ }
+ if (j == colors.length) {
+ break;
+ }
+ total += Math.max(0, (len - k + 1));
+ }
+ i = j;
+ len = 0;
+ }
+ if (colors[0] != colors[colors.length - 1]) {
+ // if(len == colors.length) {
+ // return Math.max(0, colors.length);
+ // }
+ len = len == 0 ? 2 : len + 1;
+ int j = 1;
+ while (j < colors.length && colors[j] != colors[j - 1]) {
+ j++;
+ len++;
+ }
+ if (j >= k) {
+ len -= (j - k + 1);
+ }
+ }
+ total += Math.max(0, (len - k + 1));
+ return total;
+ }
+}
diff --git a/src/main/java/g3201_3300/s3208_alternating_groups_ii/readme.md b/src/main/java/g3201_3300/s3208_alternating_groups_ii/readme.md
new file mode 100644
index 000000000..73b6d5591
--- /dev/null
+++ b/src/main/java/g3201_3300/s3208_alternating_groups_ii/readme.md
@@ -0,0 +1,58 @@
+3208\. Alternating Groups II
+
+Medium
+
+There is a circle of red and blue tiles. You are given an array of integers `colors` and an integer `k`. The color of tile `i` is represented by `colors[i]`:
+
+* `colors[i] == 0` means that tile `i` is **red**.
+* `colors[i] == 1` means that tile `i` is **blue**.
+
+An **alternating** group is every `k` contiguous tiles in the circle with **alternating** colors (each tile in the group except the first and last one has a different color from its **left** and **right** tiles).
+
+Return the number of **alternating** groups.
+
+**Note** that since `colors` represents a **circle**, the **first** and the **last** tiles are considered to be next to each other.
+
+**Example 1:**
+
+**Input:** colors = [0,1,0,1,0], k = 3
+
+**Output:** 3
+
+**Explanation:**
+
+****
+
+Alternating groups:
+
+
+
+**Example 2:**
+
+**Input:** colors = [0,1,0,0,1,0,1], k = 6
+
+**Output:** 2
+
+**Explanation:**
+
+****
+
+Alternating groups:
+
+
+
+**Example 3:**
+
+**Input:** colors = [1,1,0,1], k = 4
+
+**Output:** 0
+
+**Explanation:**
+
+
+
+**Constraints:**
+
+* 3 <= colors.length <= 105
+* `0 <= colors[i] <= 1`
+* `3 <= k <= colors.length`
\ No newline at end of file
diff --git a/src/main/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/Solution.java b/src/main/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/Solution.java
new file mode 100644
index 000000000..278140a0d
--- /dev/null
+++ b/src/main/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/Solution.java
@@ -0,0 +1,26 @@
+package g3201_3300.s3209_number_of_subarrays_with_and_value_of_k;
+
+// #Hard #Array #Binary_Search #Bit_Manipulation #Segment_Tree
+// #2024_07_09_Time_7_ms_(100.00%)_Space_62.9_MB_(11.74%)
+
+public class Solution {
+ public long countSubarrays(int[] nums, int k) {
+ long ans = 0;
+ int left = 0;
+ int right = 0;
+ for (int i = 0; i < nums.length; i++) {
+ int x = nums[i];
+ for (int j = i - 1; j >= 0 && (nums[j] & x) != nums[j]; j--) {
+ nums[j] &= x;
+ }
+ while (left <= i && nums[left] < k) {
+ left++;
+ }
+ while (right <= i && nums[right] <= k) {
+ right++;
+ }
+ ans += right - left;
+ }
+ return ans;
+ }
+}
diff --git a/src/main/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/readme.md b/src/main/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/readme.md
new file mode 100644
index 000000000..3cf6d05f4
--- /dev/null
+++ b/src/main/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/readme.md
@@ -0,0 +1,40 @@
+3209\. Number of Subarrays With AND Value of K
+
+Hard
+
+Given an array of integers `nums` and an integer `k`, return the number of subarrays of `nums` where the bitwise `AND` of the elements of the subarray equals `k`.
+
+**Example 1:**
+
+**Input:** nums = [1,1,1], k = 1
+
+**Output:** 6
+
+**Explanation:**
+
+All subarrays contain only 1's.
+
+**Example 2:**
+
+**Input:** nums = [1,1,2], k = 1
+
+**Output:** 3
+
+**Explanation:**
+
+Subarrays having an `AND` value of 1 are: [**1**,1,2]
, [1,**1**,2]
, [**1,1**,2]
.
+
+**Example 3:**
+
+**Input:** nums = [1,2,3], k = 2
+
+**Output:** 2
+
+**Explanation:**
+
+Subarrays having an `AND` value of 2 are: [1,**2**,3]
, [1,**2,3**]
.
+
+**Constraints:**
+
+* 1 <= nums.length <= 105
+* 0 <= nums[i], k <= 109
\ No newline at end of file
diff --git a/src/main/java/g3201_3300/s3210_find_the_encrypted_string/Solution.java b/src/main/java/g3201_3300/s3210_find_the_encrypted_string/Solution.java
new file mode 100644
index 000000000..92abd65b9
--- /dev/null
+++ b/src/main/java/g3201_3300/s3210_find_the_encrypted_string/Solution.java
@@ -0,0 +1,13 @@
+package g3201_3300.s3210_find_the_encrypted_string;
+
+// #Easy #String #2024_07_09_Time_1_ms_(100.00%)_Space_42.8_MB_(34.96%)
+
+public class Solution {
+ public String getEncryptedString(String s, int k) {
+ int n = s.length();
+ k = k % n;
+ StringBuilder str = new StringBuilder(s.substring(k, n));
+ str.append(s.substring(0, k));
+ return str.toString();
+ }
+}
diff --git a/src/main/java/g3201_3300/s3210_find_the_encrypted_string/readme.md b/src/main/java/g3201_3300/s3210_find_the_encrypted_string/readme.md
new file mode 100644
index 000000000..08db6266f
--- /dev/null
+++ b/src/main/java/g3201_3300/s3210_find_the_encrypted_string/readme.md
@@ -0,0 +1,38 @@
+3210\. Find the Encrypted String
+
+Easy
+
+You are given a string `s` and an integer `k`. Encrypt the string using the following algorithm:
+
+* For each character `c` in `s`, replace `c` with the kth
character after `c` in the string (in a cyclic manner).
+
+Return the _encrypted string_.
+
+**Example 1:**
+
+**Input:** s = "dart", k = 3
+
+**Output:** "tdar"
+
+**Explanation:**
+
+* For `i = 0`, the 3rd character after `'d'` is `'t'`.
+* For `i = 1`, the 3rd character after `'a'` is `'d'`.
+* For `i = 2`, the 3rd character after `'r'` is `'a'`.
+* For `i = 3`, the 3rd character after `'t'` is `'r'`.
+
+**Example 2:**
+
+**Input:** s = "aaa", k = 1
+
+**Output:** "aaa"
+
+**Explanation:**
+
+As all the characters are the same, the encrypted string will also be the same.
+
+**Constraints:**
+
+* `1 <= s.length <= 100`
+* 1 <= k <= 104
+* `s` consists only of lowercase English letters.
\ No newline at end of file
diff --git a/src/main/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/Solution.java b/src/main/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/Solution.java
new file mode 100644
index 000000000..6abb1b6a3
--- /dev/null
+++ b/src/main/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/Solution.java
@@ -0,0 +1,37 @@
+package g3201_3300.s3211_generate_binary_strings_without_adjacent_zeros;
+
+// #Medium #String #Bit_Manipulation #Recursion #2024_07_09_Time_1_ms_(100.00%)_Space_46_MB_(27.65%)
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Solution {
+ public List validStrings(int n) {
+ List strings = new ArrayList<>();
+ dfs(n, new StringBuilder(), strings);
+ return strings;
+ }
+
+ private void dfs(int n, StringBuilder build, List strings) {
+ if (build.length() == n) {
+ strings.add(build.toString());
+ return;
+ }
+ // need to add a one
+ if (!build.isEmpty() && build.charAt(build.length() - 1) == '0') {
+ build.append('1');
+ dfs(n, build, strings);
+ // undo for backtracking
+ build.setLength(build.length() - 1);
+ return;
+ }
+ // choose to append a one
+ build.append('1');
+ dfs(n, build, strings);
+ build.setLength(build.length() - 1);
+ // choose to append a zero
+ build.append('0');
+ dfs(n, build, strings);
+ build.setLength(build.length() - 1);
+ }
+}
diff --git a/src/main/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/readme.md b/src/main/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/readme.md
new file mode 100644
index 000000000..87c61912f
--- /dev/null
+++ b/src/main/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/readme.md
@@ -0,0 +1,33 @@
+3211\. Generate Binary Strings Without Adjacent Zeros
+
+Medium
+
+You are given a positive integer `n`.
+
+A binary string `x` is **valid** if all substrings of `x` of length 2 contain **at least** one `"1"`.
+
+Return all **valid** strings with length `n`**,** in _any_ order.
+
+**Example 1:**
+
+**Input:** n = 3
+
+**Output:** ["010","011","101","110","111"]
+
+**Explanation:**
+
+The valid strings of length 3 are: `"010"`, `"011"`, `"101"`, `"110"`, and `"111"`.
+
+**Example 2:**
+
+**Input:** n = 1
+
+**Output:** ["0","1"]
+
+**Explanation:**
+
+The valid strings of length 1 are: `"0"` and `"1"`.
+
+**Constraints:**
+
+* `1 <= n <= 18`
\ No newline at end of file
diff --git a/src/main/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/Solution.java b/src/main/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/Solution.java
new file mode 100644
index 000000000..00de7e34c
--- /dev/null
+++ b/src/main/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/Solution.java
@@ -0,0 +1,25 @@
+package g3201_3300.s3212_count_submatrices_with_equal_frequency_of_x_and_y;
+
+// #Medium #Array #Matrix #Prefix_Sum #2024_07_09_Time_15_ms_(100.00%)_Space_117_MB_(99.13%)
+
+public class Solution {
+ public int numberOfSubmatrices(char[][] grid) {
+ int n = grid[0].length;
+ int ans = 0;
+ int[][] row = new int[n][2];
+ for (char[] chars : grid) {
+ int[] count = new int[2];
+ for (int j = 0; j < n; j++) {
+ if (chars[j] != '.') {
+ count[chars[j] - 'X']++;
+ }
+ row[j][0] += count[0];
+ row[j][1] += count[1];
+ if (row[j][0] > 0 && row[j][0] == row[j][1]) {
+ ans++;
+ }
+ }
+ }
+ return ans;
+ }
+}
diff --git a/src/main/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/readme.md b/src/main/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/readme.md
new file mode 100644
index 000000000..5f0787647
--- /dev/null
+++ b/src/main/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/readme.md
@@ -0,0 +1,44 @@
+3212\. Count Submatrices With Equal Frequency of X and Y
+
+Medium
+
+Given a 2D character matrix `grid`, where `grid[i][j]` is either `'X'`, `'Y'`, or `'.'`, return the number of submatrices that contains:
+
+* `grid[0][0]`
+* an **equal** frequency of `'X'` and `'Y'`.
+* **at least** one `'X'`.
+
+**Example 1:**
+
+**Input:** grid = [["X","Y","."],["Y",".","."]]
+
+**Output:** 3
+
+**Explanation:**
+
+****
+
+**Example 2:**
+
+**Input:** grid = [["X","X"],["X","Y"]]
+
+**Output:** 0
+
+**Explanation:**
+
+No submatrix has an equal frequency of `'X'` and `'Y'`.
+
+**Example 3:**
+
+**Input:** grid = [[".","."],[".","."]]
+
+**Output:** 0
+
+**Explanation:**
+
+No submatrix has at least one `'X'`.
+
+**Constraints:**
+
+* `1 <= grid.length, grid[i].length <= 1000`
+* `grid[i][j]` is either `'X'`, `'Y'`, or `'.'`.
\ No newline at end of file
diff --git a/src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost/Solution.java b/src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost/Solution.java
new file mode 100644
index 000000000..033d705ca
--- /dev/null
+++ b/src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost/Solution.java
@@ -0,0 +1,62 @@
+package g3201_3300.s3213_construct_string_with_minimum_cost;
+
+// #Hard #Array #String #Dynamic_Programming #Suffix_Array
+// #2024_07_09_Time_182_ms_(100.00%)_Space_61.4_MB_(72.97%)
+
+import java.util.Arrays;
+
+public class Solution {
+ private static int invalid = Integer.MAX_VALUE;
+
+ private static class Node {
+ int cost = -1;
+ Node[] chd = new Node[26];
+ }
+
+ private Node rt;
+
+ public int minimumCost(String target, String[] words, int[] costs) {
+ rt = new Node();
+ int m = words.length;
+ int n = target.length();
+ for (int i = 0; i < m; ++i) {
+ if (words[i].length() <= n) {
+ insert(words[i], costs[i]);
+ }
+ }
+ int[] dp = new int[n + 1];
+ Arrays.fill(dp, invalid);
+ dp[0] = 0;
+ for (int i = 0; i < n; ++i) {
+ if (dp[i] == invalid) {
+ continue;
+ }
+ int nowC = dp[i];
+ Node now = rt;
+ for (int j = i; now != null && j < n; ++j) {
+ int ch = target.charAt(j) - 'a';
+ now = now.chd[ch];
+ if (now != null && now.cost != -1) {
+ dp[j + 1] = Math.min(dp[j + 1], nowC + now.cost);
+ }
+ }
+ }
+
+ return dp[n] == invalid ? -1 : dp[n];
+ }
+
+ private void insert(String wd, int cst) {
+ int len = wd.length();
+ Node now = rt;
+ for (int i = 0; i < len; ++i) {
+ int ch = wd.charAt(i) - 'a';
+ if (now.chd[ch] == null) {
+ now.chd[ch] = new Node();
+ }
+ now = now.chd[ch];
+ }
+ if (now.cost == -1 || now.cost > cst) {
+ now.cost = cst;
+ }
+ }
+}
diff --git a/src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost/readme.md b/src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost/readme.md
new file mode 100644
index 000000000..a78d9bf21
--- /dev/null
+++ b/src/main/java/g3201_3300/s3213_construct_string_with_minimum_cost/readme.md
@@ -0,0 +1,48 @@
+3213\. Construct String with Minimum Cost
+
+Hard
+
+You are given a string `target`, an array of strings `words`, and an integer array `costs`, both arrays of the same length.
+
+Imagine an empty string `s`.
+
+You can perform the following operation any number of times (including **zero**):
+
+* Choose an index `i` in the range `[0, words.length - 1]`.
+* Append `words[i]` to `s`.
+* The cost of operation is `costs[i]`.
+
+Return the **minimum** cost to make `s` equal to `target`. If it's not possible, return `-1`.
+
+**Example 1:**
+
+**Input:** target = "abcdef", words = ["abdef","abc","d","def","ef"], costs = [100,1,1,10,5]
+
+**Output:** 7
+
+**Explanation:**
+
+The minimum cost can be achieved by performing the following operations:
+
+* Select index 1 and append `"abc"` to `s` at a cost of 1, resulting in `s = "abc"`.
+* Select index 2 and append `"d"` to `s` at a cost of 1, resulting in `s = "abcd"`.
+* Select index 4 and append `"ef"` to `s` at a cost of 5, resulting in `s = "abcdef"`.
+
+**Example 2:**
+
+**Input:** target = "aaaa", words = ["z","zz","zzz"], costs = [1,10,100]
+
+**Output:** \-1
+
+**Explanation:**
+
+It is impossible to make `s` equal to `target`, so we return -1.
+
+**Constraints:**
+
+* 1 <= target.length <= 5 * 104
+* 1 <= words.length == costs.length <= 5 * 104
+* `1 <= words[i].length <= target.length`
+* The total sum of `words[i].length` is less than or equal to 5 * 104
.
+* `target` and `words[i]` consist only of lowercase English letters.
+* 1 <= costs[i] <= 104
\ No newline at end of file
diff --git a/src/test/java/g3201_3300/s3206_alternating_groups_i/SolutionTest.java b/src/test/java/g3201_3300/s3206_alternating_groups_i/SolutionTest.java
new file mode 100644
index 000000000..cc29f6c80
--- /dev/null
+++ b/src/test/java/g3201_3300/s3206_alternating_groups_i/SolutionTest.java
@@ -0,0 +1,18 @@
+package g3201_3300.s3206_alternating_groups_i;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+class SolutionTest {
+ @Test
+ void numberOfAlternatingGroups() {
+ assertThat(new Solution().numberOfAlternatingGroups(new int[] {1, 1, 1}), equalTo(0));
+ }
+
+ @Test
+ void numberOfAlternatingGroups2() {
+ assertThat(new Solution().numberOfAlternatingGroups(new int[] {0, 1, 0, 0, 1}), equalTo(3));
+ }
+}
diff --git a/src/test/java/g3201_3300/s3207_maximum_points_after_enemy_battles/SolutionTest.java b/src/test/java/g3201_3300/s3207_maximum_points_after_enemy_battles/SolutionTest.java
new file mode 100644
index 000000000..285e54fa8
--- /dev/null
+++ b/src/test/java/g3201_3300/s3207_maximum_points_after_enemy_battles/SolutionTest.java
@@ -0,0 +1,18 @@
+package g3201_3300.s3207_maximum_points_after_enemy_battles;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+class SolutionTest {
+ @Test
+ void maximumPoints() {
+ assertThat(new Solution().maximumPoints(new int[] {3, 2, 2}, 2), equalTo(3L));
+ }
+
+ @Test
+ void maximumPoints2() {
+ assertThat(new Solution().maximumPoints(new int[] {2}, 10), equalTo(5L));
+ }
+}
diff --git a/src/test/java/g3201_3300/s3208_alternating_groups_ii/SolutionTest.java b/src/test/java/g3201_3300/s3208_alternating_groups_ii/SolutionTest.java
new file mode 100644
index 000000000..c45decdcb
--- /dev/null
+++ b/src/test/java/g3201_3300/s3208_alternating_groups_ii/SolutionTest.java
@@ -0,0 +1,26 @@
+package g3201_3300.s3208_alternating_groups_ii;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+class SolutionTest {
+ @Test
+ void numberOfAlternatingGroups() {
+ assertThat(
+ new Solution().numberOfAlternatingGroups(new int[] {0, 1, 0, 1, 0}, 3), equalTo(3));
+ }
+
+ @Test
+ void numberOfAlternatingGroups2() {
+ assertThat(
+ new Solution().numberOfAlternatingGroups(new int[] {0, 1, 0, 0, 1, 0, 1}, 6),
+ equalTo(2));
+ }
+
+ @Test
+ void numberOfAlternatingGroups3() {
+ assertThat(new Solution().numberOfAlternatingGroups(new int[] {1, 1, 0, 1}, 4), equalTo(0));
+ }
+}
diff --git a/src/test/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/SolutionTest.java b/src/test/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/SolutionTest.java
new file mode 100644
index 000000000..571222be8
--- /dev/null
+++ b/src/test/java/g3201_3300/s3209_number_of_subarrays_with_and_value_of_k/SolutionTest.java
@@ -0,0 +1,18 @@
+package g3201_3300.s3209_number_of_subarrays_with_and_value_of_k;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+class SolutionTest {
+ @Test
+ void countSubarrays() {
+ assertThat(new Solution().countSubarrays(new int[] {1, 1, 2}, 1), equalTo(3L));
+ }
+
+ @Test
+ void countSubarrays2() {
+ assertThat(new Solution().countSubarrays(new int[] {1, 2, 3}, 2), equalTo(2L));
+ }
+}
diff --git a/src/test/java/g3201_3300/s3210_find_the_encrypted_string/SolutionTest.java b/src/test/java/g3201_3300/s3210_find_the_encrypted_string/SolutionTest.java
new file mode 100644
index 000000000..03d0b70eb
--- /dev/null
+++ b/src/test/java/g3201_3300/s3210_find_the_encrypted_string/SolutionTest.java
@@ -0,0 +1,18 @@
+package g3201_3300.s3210_find_the_encrypted_string;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+class SolutionTest {
+ @Test
+ void getEncryptedString() {
+ assertThat(new Solution().getEncryptedString("dart", 3), equalTo("tdar"));
+ }
+
+ @Test
+ void getEncryptedString2() {
+ assertThat(new Solution().getEncryptedString("aaa", 1), equalTo("aaa"));
+ }
+}
diff --git a/src/test/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/SolutionTest.java b/src/test/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/SolutionTest.java
new file mode 100644
index 000000000..aadd0e358
--- /dev/null
+++ b/src/test/java/g3201_3300/s3211_generate_binary_strings_without_adjacent_zeros/SolutionTest.java
@@ -0,0 +1,21 @@
+package g3201_3300.s3211_generate_binary_strings_without_adjacent_zeros;
+
+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 validStrings() {
+ assertThat(
+ new Solution().validStrings(3),
+ equalTo(List.of("111", "110", "101", "011", "010")));
+ }
+
+ @Test
+ void validStrings2() {
+ assertThat(new Solution().validStrings(1), equalTo(List.of("1", "0")));
+ }
+}
diff --git a/src/test/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/SolutionTest.java b/src/test/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/SolutionTest.java
new file mode 100644
index 000000000..bb74c7e68
--- /dev/null
+++ b/src/test/java/g3201_3300/s3212_count_submatrices_with_equal_frequency_of_x_and_y/SolutionTest.java
@@ -0,0 +1,29 @@
+package g3201_3300.s3212_count_submatrices_with_equal_frequency_of_x_and_y;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+class SolutionTest {
+ @Test
+ void numberOfSubmatrices() {
+ assertThat(
+ new Solution().numberOfSubmatrices(new char[][] {{'X', 'Y', '.'}, {'Y', '.', '.'}}),
+ equalTo(3));
+ }
+
+ @Test
+ void numberOfSubmatrices2() {
+ assertThat(
+ new Solution().numberOfSubmatrices(new char[][] {{'X', 'X'}, {'X', 'Y'}}),
+ equalTo(0));
+ }
+
+ @Test
+ void numberOfSubmatrices3() {
+ assertThat(
+ new Solution().numberOfSubmatrices(new char[][] {{'.', '.'}, {'.', '.'}}),
+ equalTo(0));
+ }
+}
diff --git a/src/test/java/g3201_3300/s3213_construct_string_with_minimum_cost/SolutionTest.java b/src/test/java/g3201_3300/s3213_construct_string_with_minimum_cost/SolutionTest.java
new file mode 100644
index 000000000..57b0225ba
--- /dev/null
+++ b/src/test/java/g3201_3300/s3213_construct_string_with_minimum_cost/SolutionTest.java
@@ -0,0 +1,28 @@
+package g3201_3300.s3213_construct_string_with_minimum_cost;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.jupiter.api.Test;
+
+class SolutionTest {
+ @Test
+ void minimumCost() {
+ assertThat(
+ new Solution()
+ .minimumCost(
+ "abcdef",
+ new String[] {"abdef", "abc", "d", "def", "ef"},
+ new int[] {100, 1, 1, 10, 5}),
+ equalTo(7));
+ }
+
+ @Test
+ void minimumCost2() {
+ assertThat(
+ new Solution()
+ .minimumCost(
+ "aaaa", new String[] {"z", "zz", "zzz"}, new int[] {1, 10, 100}),
+ equalTo(-1));
+ }
+}