diff --git a/src/main/java/leetcode/editor/cn/ChalkboardXorGame.java b/src/main/java/leetcode/editor/cn/ChalkboardXorGame.java
new file mode 100644
index 0000000..ce77671
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/ChalkboardXorGame.java
@@ -0,0 +1,58 @@
+//黑板上写着一个非负整数数组 nums[i] 。Alice 和 Bob 轮流从黑板上擦掉一个数字,Alice 先手。如果擦除一个数字后,剩余的所有数字按位异或
+//运算得出的结果等于 0 的话,当前玩家游戏失败。 (另外,如果只剩一个数字,按位异或运算得到它本身;如果无数字剩余,按位异或运算结果为 0。)
+//
+// 换种说法就是,轮到某个玩家时,如果当前黑板上所有数字按位异或运算结果等于 0,这个玩家获胜。
+//
+// 假设两个玩家每步都使用最优解,当且仅当 Alice 获胜时返回 true。
+//
+//
+//
+// 示例:
+//
+//
+//输入: nums = [1, 1, 2]
+//输出: false
+//解释:
+//Alice 有两个选择: 擦掉数字 1 或 2。
+//如果擦掉 1, 数组变成 [1, 2]。剩余数字按位异或得到 1 XOR 2 = 3。那么 Bob 可以擦掉任意数字,因为 Alice 会成为擦掉最后一个数
+//字的人,她总是会输。
+//如果 Alice 擦掉 2,那么数组变成[1, 1]。剩余数字按位异或得到 1 XOR 1 = 0。Alice 仍然会输掉游戏。
+//
+//
+//
+//
+// 提示:
+//
+//
+// 1 <= N <= 1000
+// 0 <= nums[i] <= 2^16
+//
+// Related Topics 数学
+// 👍 44 👎 0
+
+package leetcode.editor.cn;
+
+//810:黑板异或游戏
+public class ChalkboardXorGame {
+ public static void main(String[] args) {
+ //测试代码
+ Solution solution = new ChalkboardXorGame().new Solution();
+ }
+
+ //力扣代码
+ //leetcode submit region begin(Prohibit modification and deletion)
+ class Solution {
+ public boolean xorGame(int[] nums) {
+ if (nums.length % 2 == 0) {
+ return true;
+ }
+ int xor = 0;
+ for (int num : nums) {
+ xor ^= num;
+ }
+ return xor == 0;
+ }
+ }
+//leetcode submit region end(Prohibit modification and deletion)
+
+}
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/ChalkboardXorGame.md b/src/main/java/leetcode/editor/cn/ChalkboardXorGame.md
new file mode 100644
index 0000000..63ccee7
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/ChalkboardXorGame.md
@@ -0,0 +1,28 @@
+
黑板上写着一个非负整数数组 nums[i]
。Alice 和 Bob 轮流从黑板上擦掉一个数字,Alice 先手。如果擦除一个数字后,剩余的所有数字按位异或运算得出的结果等于 0 的话,当前玩家游戏失败。 (另外,如果只剩一个数字,按位异或运算得到它本身;如果无数字剩余,按位异或运算结果为 0。)
+
+换种说法就是,轮到某个玩家时,如果当前黑板上所有数字按位异或运算结果等于 0,这个玩家获胜。
+
+假设两个玩家每步都使用最优解,当且仅当 Alice 获胜时返回 true
。
+
+
+
+示例:
+
+
+输入: nums = [1, 1, 2]
+输出: false
+解释:
+Alice 有两个选择: 擦掉数字 1 或 2。
+如果擦掉 1, 数组变成 [1, 2]。剩余数字按位异或得到 1 XOR 2 = 3。那么 Bob 可以擦掉任意数字,因为 Alice 会成为擦掉最后一个数字的人,她总是会输。
+如果 Alice 擦掉 2,那么数组变成[1, 1]。剩余数字按位异或得到 1 XOR 1 = 0。Alice 仍然会输掉游戏。
+
+
+
+
+提示:
+
+
+ 1 <= N <= 1000
+ 0 <= nums[i] <= 2^16
+
+\n👍 44👎 0
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/DesignAStackWithIncrementOperation.java b/src/main/java/leetcode/editor/cn/DesignAStackWithIncrementOperation.java
new file mode 100644
index 0000000..5f141f2
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/DesignAStackWithIncrementOperation.java
@@ -0,0 +1,111 @@
+//请你设计一个支持下述操作的栈。
+//
+// 实现自定义栈类 CustomStack :
+//
+//
+// CustomStack(int maxSize):用 maxSize 初始化对象,maxSize 是栈中最多能容纳的元素数量,栈在增长到 maxSize
+//之后则不支持 push 操作。
+// void push(int x):如果栈还未增长到 maxSize ,就将 x 添加到栈顶。
+// int pop():弹出栈顶元素,并返回栈顶的值,或栈为空时返回 -1 。
+// void inc(int k, int val):栈底的 k 个元素的值都增加 val 。如果栈中元素总数小于 k ,则栈中的所有元素都增加 val 。
+//
+//
+//
+//
+//
+// 示例:
+//
+// 输入:
+//["CustomStack","push","push","pop","push","push","push","increment","increment
+//","pop","pop","pop","pop"]
+//[[3],[1],[2],[],[2],[3],[4],[5,100],[2,100],[],[],[],[]]
+//输出:
+//[null,null,null,2,null,null,null,null,null,103,202,201,-1]
+//解释:
+//CustomStack customStack = new CustomStack(3); // 栈是空的 []
+//customStack.push(1); // 栈变为 [1]
+//customStack.push(2); // 栈变为 [1, 2]
+//customStack.pop(); // 返回 2 --> 返回栈顶值 2,栈变为 [1]
+//customStack.push(2); // 栈变为 [1, 2]
+//customStack.push(3); // 栈变为 [1, 2, 3]
+//customStack.push(4); // 栈仍然是 [1, 2, 3],不能添加其他元素使栈大小变为
+// 4
+//customStack.increment(5, 100); // 栈变为 [101, 102, 103]
+//customStack.increment(2, 100); // 栈变为 [201, 202, 103]
+//customStack.pop(); // 返回 103 --> 返回栈顶值 103,栈变为 [201
+//, 202]
+//customStack.pop(); // 返回 202 --> 返回栈顶值 202,栈变为 [201
+//]
+//customStack.pop(); // 返回 201 --> 返回栈顶值 201,栈变为 []
+//customStack.pop(); // 返回 -1 --> 栈为空,返回 -1
+//
+//
+//
+//
+// 提示:
+//
+//
+// 1 <= maxSize <= 1000
+// 1 <= x <= 1000
+// 1 <= k <= 1000
+// 0 <= val <= 100
+// 每种方法 increment,push 以及 pop 分别最多调用 1000 次
+//
+// Related Topics 栈 设计
+// 👍 47 👎 0
+
+package leetcode.editor.cn;
+
+//1381:设计一个支持增量操作的栈
+public class DesignAStackWithIncrementOperation {
+ public static void main(String[] args) {
+ //测试代码
+// Solution solution = new DesignAStackWithIncrementOperation().new Solution();
+ }
+
+ //力扣代码
+ //leetcode submit region begin(Prohibit modification and deletion)
+ class CustomStack {
+ int[] stack;
+ int index;
+
+ public CustomStack(int maxSize) {
+ stack = new int[maxSize];
+ index = 0;
+ }
+
+ public void push(int x) {
+ if (index < stack.length) {
+ stack[index] = x;
+ index++;
+ }
+ }
+
+ public int pop() {
+ if(index==0){
+ return -1;
+ }
+ index--;
+ int num = stack[index];
+ stack[index] = 0;
+ return num;
+ }
+
+ public void increment(int k, int val) {
+ int size = Math.min(index, k);
+ for (int i = 0; i < size; i++) {
+ stack[i] += val;
+ }
+ }
+ }
+
+/**
+ * Your CustomStack object will be instantiated and called as such:
+ * CustomStack obj = new CustomStack(maxSize);
+ * obj.push(x);
+ * int param_2 = obj.pop();
+ * obj.increment(k,val);
+ */
+//leetcode submit region end(Prohibit modification and deletion)
+
+}
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/DesignAStackWithIncrementOperation.md b/src/main/java/leetcode/editor/cn/DesignAStackWithIncrementOperation.md
new file mode 100644
index 0000000..5a4e459
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/DesignAStackWithIncrementOperation.md
@@ -0,0 +1,48 @@
+请你设计一个支持下述操作的栈。
+
+实现自定义栈类 CustomStack
:
+
+
+ CustomStack(int maxSize)
:用 maxSize
初始化对象,maxSize
是栈中最多能容纳的元素数量,栈在增长到 maxSize
之后则不支持 push
操作。
+ void push(int x)
:如果栈还未增长到 maxSize
,就将 x
添加到栈顶。
+ int pop()
:弹出栈顶元素,并返回栈顶的值,或栈为空时返回 -1 。
+ void inc(int k, int val)
:栈底的 k
个元素的值都增加 val
。如果栈中元素总数小于 k
,则栈中的所有元素都增加 val
。
+
+
+
+
+示例:
+
+输入:
+["CustomStack","push","push","pop","push","push","push","increment","increment","pop","pop","pop","pop"]
+[[3],[1],[2],[],[2],[3],[4],[5,100],[2,100],[],[],[],[]]
+输出:
+[null,null,null,2,null,null,null,null,null,103,202,201,-1]
+解释:
+CustomStack customStack = new CustomStack(3); // 栈是空的 []
+customStack.push(1); // 栈变为 [1]
+customStack.push(2); // 栈变为 [1, 2]
+customStack.pop(); // 返回 2 --> 返回栈顶值 2,栈变为 [1]
+customStack.push(2); // 栈变为 [1, 2]
+customStack.push(3); // 栈变为 [1, 2, 3]
+customStack.push(4); // 栈仍然是 [1, 2, 3],不能添加其他元素使栈大小变为 4
+customStack.increment(5, 100); // 栈变为 [101, 102, 103]
+customStack.increment(2, 100); // 栈变为 [201, 202, 103]
+customStack.pop(); // 返回 103 --> 返回栈顶值 103,栈变为 [201, 202]
+customStack.pop(); // 返回 202 --> 返回栈顶值 202,栈变为 [201]
+customStack.pop(); // 返回 201 --> 返回栈顶值 201,栈变为 []
+customStack.pop(); // 返回 -1 --> 栈为空,返回 -1
+
+
+
+
+提示:
+
+
+ 1 <= maxSize <= 1000
+ 1 <= x <= 1000
+ 1 <= k <= 1000
+ 0 <= val <= 100
+ - 每种方法
increment
,push
以及 pop
分别最多调用 1000
次
+
+\n👍 47👎 0
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/HammingDistance.java b/src/main/java/leetcode/editor/cn/HammingDistance.java
new file mode 100644
index 0000000..b5842b6
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/HammingDistance.java
@@ -0,0 +1,43 @@
+//两个整数之间的汉明距离指的是这两个数字对应二进制位不同的位置的数目。
+//
+// 给出两个整数 x 和 y,计算它们之间的汉明距离。
+//
+// 注意:
+//0 ≤ x, y < 231.
+//
+// 示例:
+//
+//
+//输入: x = 1, y = 4
+//
+//输出: 2
+//
+//解释:
+//1 (0 0 0 1)
+//4 (0 1 0 0)
+// ↑ ↑
+//
+//上面的箭头指出了对应二进制位不同的位置。
+//
+// Related Topics 位运算
+// 👍 426 👎 0
+
+package leetcode.editor.cn;
+
+//461:汉明距离
+public class HammingDistance {
+ public static void main(String[] args) {
+ //测试代码
+ Solution solution = new HammingDistance().new Solution();
+ }
+
+ //力扣代码
+ //leetcode submit region begin(Prohibit modification and deletion)
+ class Solution {
+ public int hammingDistance(int x, int y) {
+ return Integer.bitCount(x ^ y);
+ }
+ }
+//leetcode submit region end(Prohibit modification and deletion)
+
+}
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/HammingDistance.md b/src/main/java/leetcode/editor/cn/HammingDistance.md
new file mode 100644
index 0000000..36df173
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/HammingDistance.md
@@ -0,0 +1,22 @@
+两个整数之间的汉明距离指的是这两个数字对应二进制位不同的位置的数目。
+
+给出两个整数 x
和 y
,计算它们之间的汉明距离。
+
+注意:
+0 ≤ x
, y
< 231.
+
+示例:
+
+
+输入: x = 1, y = 4
+
+输出: 2
+
+解释:
+1 (0 0 0 1)
+4 (0 1 0 0)
+ ↑ ↑
+
+上面的箭头指出了对应二进制位不同的位置。
+
+\n👍 426👎 0
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/HtmlEntityParser.java b/src/main/java/leetcode/editor/cn/HtmlEntityParser.java
new file mode 100644
index 0000000..327ca7e
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/HtmlEntityParser.java
@@ -0,0 +1,90 @@
+//「HTML 实体解析器」 是一种特殊的解析器,它将 HTML 代码作为输入,并用字符本身替换掉所有这些特殊的字符实体。
+//
+// HTML 里这些特殊字符和它们对应的字符实体包括:
+//
+//
+// 双引号:字符实体为 " ,对应的字符是 " 。
+// 单引号:字符实体为 ' ,对应的字符是 ' 。
+// 与符号:字符实体为 & ,对应对的字符是 & 。
+// 大于号:字符实体为 > ,对应的字符是 > 。
+// 小于号:字符实体为 < ,对应的字符是 < 。
+// 斜线号:字符实体为 ⁄ ,对应的字符是 / 。
+//
+//
+// 给你输入字符串 text ,请你实现一个 HTML 实体解析器,返回解析器解析后的结果。
+//
+//
+//
+// 示例 1:
+//
+//
+//输入:text = "& is an HTML entity but &ambassador; is not."
+//输出:"& is an HTML entity but &ambassador; is not."
+//解释:解析器把字符实体 & 用 & 替换
+//
+//
+// 示例 2:
+//
+//
+//输入:text = "and I quote: "...""
+//输出:"and I quote: \"...\""
+//
+//
+// 示例 3:
+//
+//
+//输入:text = "Stay home! Practice on Leetcode :)"
+//输出:"Stay home! Practice on Leetcode :)"
+//
+//
+// 示例 4:
+//
+//
+//输入:text = "x > y && x < y is always false"
+//输出:"x > y && x < y is always false"
+//
+//
+// 示例 5:
+//
+//
+//输入:text = "leetcode.com⁄problemset⁄all"
+//输出:"leetcode.com/problemset/all"
+//
+//
+//
+//
+// 提示:
+//
+//
+// 1 <= text.length <= 10^5
+// 字符串可能包含 256 个ASCII 字符中的任意字符。
+//
+// Related Topics 栈 字符串
+// 👍 12 👎 0
+
+package leetcode.editor.cn;
+
+import java.util.Stack;
+
+//1410:HTML 实体解析器
+public class HtmlEntityParser{
+ public static void main(String[] args) {
+ //测试代码
+ Solution solution = new HtmlEntityParser().new Solution();
+ }
+ //力扣代码
+ //leetcode submit region begin(Prohibit modification and deletion)
+class Solution {
+ public String entityParser(String text) {
+ return text.
+ replace(""", "\"").
+ replace("'", "'").
+ replace(">", ">").
+ replace("<", "<").
+ replace("⁄", "/").
+ replace("&", "&");
+ }
+}
+//leetcode submit region end(Prohibit modification and deletion)
+
+}
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/HtmlEntityParser.md b/src/main/java/leetcode/editor/cn/HtmlEntityParser.md
new file mode 100644
index 0000000..324285c
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/HtmlEntityParser.md
@@ -0,0 +1,62 @@
+「HTML 实体解析器」 是一种特殊的解析器,它将 HTML 代码作为输入,并用字符本身替换掉所有这些特殊的字符实体。
+
+HTML 里这些特殊字符和它们对应的字符实体包括:
+
+
+ - 双引号:字符实体为
"
,对应的字符是 "
。
+ - 单引号:字符实体为
'
,对应的字符是 '
。
+ - 与符号:字符实体为
&
,对应对的字符是 &
。
+ - 大于号:字符实体为
>
,对应的字符是 >
。
+ - 小于号:字符实体为
<
,对应的字符是 <
。
+ - 斜线号:字符实体为
⁄
,对应的字符是 /
。
+
+
+给你输入字符串 text
,请你实现一个 HTML 实体解析器,返回解析器解析后的结果。
+
+
+
+示例 1:
+
+
+输入:text = "& is an HTML entity but &ambassador; is not."
+输出:"& is an HTML entity but &ambassador; is not."
+解释:解析器把字符实体 & 用 & 替换
+
+
+示例 2:
+
+
+输入:text = "and I quote: "...""
+输出:"and I quote: \"...\""
+
+
+示例 3:
+
+
+输入:text = "Stay home! Practice on Leetcode :)"
+输出:"Stay home! Practice on Leetcode :)"
+
+
+示例 4:
+
+
+输入:text = "x > y && x < y is always false"
+输出:"x > y && x < y is always false"
+
+
+示例 5:
+
+
+输入:text = "leetcode.com⁄problemset⁄all"
+输出:"leetcode.com/problemset/all"
+
+
+
+
+提示:
+
+
+ 1 <= text.length <= 10^5
+ - 字符串可能包含 256 个ASCII 字符中的任意字符。
+
+\n👍 12👎 0
\ No newline at end of file
diff --git a/src/main/java/leetcode/editor/cn/MakeTheXorOfAllSegmentsEqualToZero.java b/src/main/java/leetcode/editor/cn/MakeTheXorOfAllSegmentsEqualToZero.java
new file mode 100644
index 0000000..05929e9
--- /dev/null
+++ b/src/main/java/leetcode/editor/cn/MakeTheXorOfAllSegmentsEqualToZero.java
@@ -0,0 +1,101 @@
+//给你一个整数数组 nums 和一个整数 k 。区间 [left, right](left <= right)的 异或结果 是对下标位于 left 和 rig
+//ht(包括 left 和 right )之间所有元素进行 XOR 运算的结果:nums[left] XOR nums[left+1] XOR ... XOR n
+//ums[right] 。
+//
+// 返回数组中 要更改的最小元素数 ,以使所有长度为 k 的区间异或结果等于零。
+//
+//
+//
+// 示例 1:
+//
+//
+//输入:nums = [1,2,0,3,0], k = 1
+//输出:3
+//解释:将数组 [1,2,0,3,0] 修改为 [0,0,0,0,0]
+//
+//
+// 示例 2:
+//
+//
+//输入:nums = [3,4,5,2,1,7,3,4,7], k = 3
+//输出:3
+//解释:将数组 [3,4,5,2,1,7,3,4,7] 修改为 [3,4,7,3,4,7,3,4,7]
+//
+//
+// 示例 3:
+//
+//
+//输入:nums = [1,2,4,1,2,5,1,2,6], k = 3
+//输出:3
+//解释:将数组[1,2,4,1,2,5,1,2,6] 修改为 [1,2,3,1,2,3,1,2,3]
+//
+//
+//
+// 提示:
+//
+//
+// 1 <= k <= nums.length <= 2000
+// 0 <= nums[i] < 210
+//
+// Related Topics 动态规划
+// 👍 57 👎 0
+
+package leetcode.editor.cn;
+
+import java.util.*;
+
+//1787:使所有区间的异或结果为零
+public class MakeTheXorOfAllSegmentsEqualToZero {
+ public static void main(String[] args) {
+ //测试代码
+ Solution solution = new MakeTheXorOfAllSegmentsEqualToZero().new Solution();
+ //3
+ System.out.println(solution.minChanges(new int[]{1,2,0,3,0},1));
+ //3
+ System.out.println(solution.minChanges(new int[]{3,4,5,2,1,7,3,4,7},3));
+ //3
+ System.out.println(solution.minChanges(new int[]{1, 2, 4, 1, 2, 5, 1, 2, 6}, 3));
+ //11
+ System.out.println(solution.minChanges(new int[]{26,19,19,28,13,14,6,25,28,19,0,15,25,11}, 3));
+ //11
+ System.out.println(solution.minChanges(new int[]{11,20,3,18,26,30,20,7,3,0,25,9,19,21,3,23}, 5));
+ }
+
+ //力扣代码
+ //leetcode submit region begin(Prohibit modification and deletion)
+ class Solution {
+ public int minChanges(int[] nums, int k) {
+ int numCount = 1 << 10;
+ List