dfs2 = [&](int i, int fa) {
+ for (auto& [j, k] : g[i]) {
+ if (j != fa) {
+ ans[j] = ans[i] + k;
+ dfs2(j, i);
+ }
+ }
+ };
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+ }
+};
+```
+
+### **Go**
+
+```go
+func minEdgeReversals(n int, edges [][]int) []int {
+ g := make([][][2]int, n)
+ for _, e := range edges {
+ x, y := e[0], e[1]
+ g[x] = append(g[x], [2]int{y, 1})
+ g[y] = append(g[y], [2]int{x, -1})
+ }
+ ans := make([]int, n)
+ var dfs func(int, int)
+ var dfs2 func(int, int)
+ dfs = func(i, fa int) {
+ for _, ne := range g[i] {
+ j, k := ne[0], ne[1]
+ if j != fa {
+ if k < 0 { + ans[0]++ + } + dfs(j, i) + } + } + } + dfs2 = func(i, fa int) { + for _, ne := range g[i] { + j, k := ne[0], ne[1] + if j != fa { + ans[j] = ans[i] + k + dfs2(j, i) + } + } + } + dfs(0, -1) + dfs2(0, -1) + return ans +} +``` + +### **TypeScript** + +```ts +function minEdgeReversals(n: number, edges: number[][]): number[] { + const g: number[][][] = Array.from({ length: n }, () => []);
+ for (const [x, y] of edges) {
+ g[x].push([y, 1]);
+ g[y].push([x, -1]);
+ }
+ const ans: number[] = Array(n).fill(0);
+ const dfs = (i: number, fa: number) => {
+ for (const [j, k] of g[i]) {
+ if (j !== fa) {
+ ans[0] += k < 0 ? 1 : 0; + dfs(j, i); + } + } + }; + const dfs2 = (i: number, fa: number) => {
+ for (const [j, k] of g[i]) {
+ if (j !== fa) {
+ ans[j] = ans[i] + k;
+ dfs2(j, i);
+ }
+ }
+ };
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+}
+```
+
+### **...**
+
+```
+
+```
+
+
diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/README_EN.md b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/README_EN.md
new file mode 100644
index 0000000000000..99a0dd9310d54
--- /dev/null
+++ b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/README_EN.md
@@ -0,0 +1,254 @@
+# [2858. Minimum Edge Reversals So Every Node Is Reachable](https://leetcode.com/problems/minimum-edge-reversals-so-every-node-is-reachable)
+
+[中文文档](/solution/2800-2899/2858.Minimum%20Edge%20Reversals%20So%20Every%20Node%20Is%20Reachable/README.md)
+
+## Description
+
+There is a simple directed graph with n
nodes labeled from 0
to n - 1
. The graph would form a tree if its edges were bi-directional.
+
+You are given an integer n
and a 2D integer array edges
, where edges[i] = [ui, vi]
represents a directed edge going from node ui
to node vi
.
+
+An edge reversal changes the direction of an edge, i.e., a directed edge going from node ui
to node vi
becomes a directed edge going from node vi
to node ui
.
+
+For every node i
in the range [0, n - 1]
, your task is to independently calculate the minimum number of edge reversals required so it is possible to reach any other node starting from node i
through a sequence of directed edges.
+
+Return an integer array answer
, where answer[i]
is the minimum number of edge reversals required so it is possible to reach any other node starting from node i
through a sequence of directed edges.
+
+
+Example 1:
+
+
+
+
+Input: n = 4, edges = [[2,0],[2,1],[1,3]]
+Output: [1,1,0,2]
+Explanation: The image above shows the graph formed by the edges.
+For node 0: after reversing the edge [2,0], it is possible to reach any other node starting from node 0.
+So, answer[0] = 1.
+For node 1: after reversing the edge [2,1], it is possible to reach any other node starting from node 1.
+So, answer[1] = 1.
+For node 2: it is already possible to reach any other node starting from node 2.
+So, answer[2] = 0.
+For node 3: after reversing the edges [1,3] and [2,1], it is possible to reach any other node starting from node 3.
+So, answer[3] = 2.
+
+
+Example 2:
+
+
+
+
+Input: n = 3, edges = [[1,2],[2,0]]
+Output: [2,0,1]
+Explanation: The image above shows the graph formed by the edges.
+For node 0: after reversing the edges [2,0] and [1,2], it is possible to reach any other node starting from node 0.
+So, answer[0] = 2.
+For node 1: it is already possible to reach any other node starting from node 1.
+So, answer[1] = 0.
+For node 2: after reversing the edge [1, 2], it is possible to reach any other node starting from node 2.
+So, answer[2] = 1.
+
+
+
+Constraints:
+
+
+ 2 <= n <= 105
+ edges.length == n - 1
+ edges[i].length == 2
+ 0 <= ui == edges[i][0] < n
+ 0 <= vi == edges[i][1] < n
+ ui != vi
+ - The input is generated such that if the edges were bi-directional, the graph would be a tree.
+
+
+## Solutions
+
+
+
+### **Python3**
+
+```python
+class Solution:
+ def minEdgeReversals(self, n: int, edges: List[List[int]]) -> List[int]:
+ ans = [0] * n
+ g = [[] for _ in range(n)]
+ for x, y in edges:
+ g[x].append((y, 1))
+ g[y].append((x, -1))
+
+ def dfs(i: int, fa: int):
+ for j, k in g[i]:
+ if j != fa:
+ ans[0] += int(k < 0) + dfs(j, i) + + dfs(0, -1) + + def dfs2(i: int, fa: int): + for j, k in g[i]: + if j != fa: + ans[j] = ans[i] + k + dfs2(j, i) + + dfs2(0, -1) + return ans +``` + +### **Java** + +```java +class Solution { + private List[] g;
+ private int[] ans;
+
+ public int[] minEdgeReversals(int n, int[][] edges) {
+ ans = new int[n];
+ g = new List[n];
+ Arrays.setAll(g, i -> new ArrayList());
+ for (var e : edges) {
+ int x = e[0], y = e[1];
+ g[x].add(new int[] {y, 1});
+ g[y].add(new int[] {x, -1});
+ }
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+ }
+
+ private void dfs(int i, int fa) {
+ for (var ne : g[i]) {
+ int j = ne[0], k = ne[1];
+ if (j != fa) {
+ ans[0] += k < 0 ? 1 : 0; + dfs(j, i); + } + } + } + + private void dfs2(int i, int fa) { + for (var ne : g[i]) { + int j = ne[0], k = ne[1]; + if (j != fa) { + ans[j] = ans[i] + k; + dfs2(j, i); + } + } + } +} +``` + +### **C++** + +```cpp +class Solution { +public: + vector minEdgeReversals(int n, vector>& edges) {
+ vector> g[n];
+ vector ans(n);
+ for (auto& e : edges) {
+ int x = e[0], y = e[1];
+ g[x].emplace_back(y, 1);
+ g[y].emplace_back(x, -1);
+ }
+ function dfs = [&](int i, int fa) {
+ for (auto& [j, k] : g[i]) {
+ if (j != fa) {
+ ans[0] += k < 0; + dfs(j, i); + } + } + }; + function dfs2 = [&](int i, int fa) {
+ for (auto& [j, k] : g[i]) {
+ if (j != fa) {
+ ans[j] = ans[i] + k;
+ dfs2(j, i);
+ }
+ }
+ };
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+ }
+};
+```
+
+### **Go**
+
+```go
+func minEdgeReversals(n int, edges [][]int) []int {
+ g := make([][][2]int, n)
+ for _, e := range edges {
+ x, y := e[0], e[1]
+ g[x] = append(g[x], [2]int{y, 1})
+ g[y] = append(g[y], [2]int{x, -1})
+ }
+ ans := make([]int, n)
+ var dfs func(int, int)
+ var dfs2 func(int, int)
+ dfs = func(i, fa int) {
+ for _, ne := range g[i] {
+ j, k := ne[0], ne[1]
+ if j != fa {
+ if k < 0 { + ans[0]++ + } + dfs(j, i) + } + } + } + dfs2 = func(i, fa int) { + for _, ne := range g[i] { + j, k := ne[0], ne[1] + if j != fa { + ans[j] = ans[i] + k + dfs2(j, i) + } + } + } + dfs(0, -1) + dfs2(0, -1) + return ans +} +``` + +### **TypeScript** + +```ts +function minEdgeReversals(n: number, edges: number[][]): number[] { + const g: number[][][] = Array.from({ length: n }, () => []);
+ for (const [x, y] of edges) {
+ g[x].push([y, 1]);
+ g[y].push([x, -1]);
+ }
+ const ans: number[] = Array(n).fill(0);
+ const dfs = (i: number, fa: number) => {
+ for (const [j, k] of g[i]) {
+ if (j !== fa) {
+ ans[0] += k < 0 ? 1 : 0; + dfs(j, i); + } + } + }; + const dfs2 = (i: number, fa: number) => {
+ for (const [j, k] of g[i]) {
+ if (j !== fa) {
+ ans[j] = ans[i] + k;
+ dfs2(j, i);
+ }
+ }
+ };
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+}
+```
+
+### **...**
+
+```
+
+```
+
+
diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.cpp b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.cpp
new file mode 100644
index 0000000000000..4ce382baef59a
--- /dev/null
+++ b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.cpp
@@ -0,0 +1,31 @@
+class Solution {
+public:
+ vector minEdgeReversals(int n, vector>& edges) {
+ vector> g[n];
+ vector ans(n);
+ for (auto& e : edges) {
+ int x = e[0], y = e[1];
+ g[x].emplace_back(y, 1);
+ g[y].emplace_back(x, -1);
+ }
+ function dfs = [&](int i, int fa) {
+ for (auto& [j, k] : g[i]) {
+ if (j != fa) {
+ ans[0] += k < 0; + dfs(j, i); + } + } + }; + function dfs2 = [&](int i, int fa) {
+ for (auto& [j, k] : g[i]) {
+ if (j != fa) {
+ ans[j] = ans[i] + k;
+ dfs2(j, i);
+ }
+ }
+ };
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+ }
+};
\ No newline at end of file
diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.go b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.go
new file mode 100644
index 0000000000000..b9fa738f376f1
--- /dev/null
+++ b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.go
@@ -0,0 +1,34 @@
+func minEdgeReversals(n int, edges [][]int) []int {
+ g := make([][][2]int, n)
+ for _, e := range edges {
+ x, y := e[0], e[1]
+ g[x] = append(g[x], [2]int{y, 1})
+ g[y] = append(g[y], [2]int{x, -1})
+ }
+ ans := make([]int, n)
+ var dfs func(int, int)
+ var dfs2 func(int, int)
+ dfs = func(i, fa int) {
+ for _, ne := range g[i] {
+ j, k := ne[0], ne[1]
+ if j != fa {
+ if k < 0 { + ans[0]++ + } + dfs(j, i) + } + } + } + dfs2 = func(i, fa int) { + for _, ne := range g[i] { + j, k := ne[0], ne[1] + if j != fa { + ans[j] = ans[i] + k + dfs2(j, i) + } + } + } + dfs(0, -1) + dfs2(0, -1) + return ans +} \ No newline at end of file diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.java b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.java new file mode 100644 index 0000000000000..5c4ba99ce072a --- /dev/null +++ b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.java @@ -0,0 +1,38 @@ +class Solution { + private List[] g;
+ private int[] ans;
+
+ public int[] minEdgeReversals(int n, int[][] edges) {
+ ans = new int[n];
+ g = new List[n];
+ Arrays.setAll(g, i -> new ArrayList());
+ for (var e : edges) {
+ int x = e[0], y = e[1];
+ g[x].add(new int[] {y, 1});
+ g[y].add(new int[] {x, -1});
+ }
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+ }
+
+ private void dfs(int i, int fa) {
+ for (var ne : g[i]) {
+ int j = ne[0], k = ne[1];
+ if (j != fa) {
+ ans[0] += k < 0 ? 1 : 0; + dfs(j, i); + } + } + } + + private void dfs2(int i, int fa) { + for (var ne : g[i]) { + int j = ne[0], k = ne[1]; + if (j != fa) { + ans[j] = ans[i] + k; + dfs2(j, i); + } + } + } +} \ No newline at end of file diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.py b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.py new file mode 100644 index 0000000000000..fe04256d8155c --- /dev/null +++ b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.py @@ -0,0 +1,24 @@ +class Solution: + def minEdgeReversals(self, n: int, edges: List[List[int]]) -> List[int]:
+ ans = [0] * n
+ g = [[] for _ in range(n)]
+ for x, y in edges:
+ g[x].append((y, 1))
+ g[y].append((x, -1))
+
+ def dfs(i: int, fa: int):
+ for j, k in g[i]:
+ if j != fa:
+ ans[0] += int(k < 0) + dfs(j, i) + + dfs(0, -1) + + def dfs2(i: int, fa: int): + for j, k in g[i]: + if j != fa: + ans[j] = ans[i] + k + dfs2(j, i) + + dfs2(0, -1) + return ans diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.ts b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.ts new file mode 100644 index 0000000000000..b28dffa38dfc4 --- /dev/null +++ b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/Solution.ts @@ -0,0 +1,27 @@ +function minEdgeReversals(n: number, edges: number[][]): number[] { + const g: number[][][] = Array.from({ length: n }, () => []);
+ for (const [x, y] of edges) {
+ g[x].push([y, 1]);
+ g[y].push([x, -1]);
+ }
+ const ans: number[] = Array(n).fill(0);
+ const dfs = (i: number, fa: number) => {
+ for (const [j, k] of g[i]) {
+ if (j !== fa) {
+ ans[0] += k < 0 ? 1 : 0; + dfs(j, i); + } + } + }; + const dfs2 = (i: number, fa: number) => {
+ for (const [j, k] of g[i]) {
+ if (j !== fa) {
+ ans[j] = ans[i] + k;
+ dfs2(j, i);
+ }
+ }
+ };
+ dfs(0, -1);
+ dfs2(0, -1);
+ return ans;
+}
diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/images/image-20230826221104-3.png b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/images/image-20230826221104-3.png
new file mode 100644
index 0000000000000..dd782e59f04a4
Binary files /dev/null and b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/images/image-20230826221104-3.png differ
diff --git a/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/images/image-20230826225541-2.png b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/images/image-20230826225541-2.png
new file mode 100644
index 0000000000000..49253a0c475af
Binary files /dev/null and b/solution/2800-2899/2858.Minimum Edge Reversals So Every Node Is Reachable/images/image-20230826225541-2.png differ
diff --git a/solution/CONTEST_README.md b/solution/CONTEST_README.md
index b031664fa8eba..c0c2988da72ce 100644
--- a/solution/CONTEST_README.md
+++ b/solution/CONTEST_README.md
@@ -22,6 +22,13 @@
## 往期竞赛
+#### 第 113 场双周赛(2023年09月16日 22:30, 90 分钟) 参赛人数 3028
+
+- [2855. 使数组成为递增数组的最少右移次数](/solution/2800-2899/2855.Minimum%20Right%20Shifts%20to%20Sort%20the%20Array/README.md)
+- [2856. 删除数对后的最小数组长度](/solution/2800-2899/2856.Minimum%20Array%20Length%20After%20Pair%20Removals/README.md)
+- [2857. 统计距离为 k 的点对](/solution/2800-2899/2857.Count%20Pairs%20of%20Points%20With%20Distance%20k/README.md)
+- [2858. 可以到达每一个节点的最少边反转次数](/solution/2800-2899/2858.Minimum%20Edge%20Reversals%20So%20Every%20Node%20Is%20Reachable/README.md)
+
#### 第 362 场周赛(2023年09月10日 10:30, 90 分钟) 参赛人数 4800
- [2848. 与车相交的点](/solution/2800-2899/2848.Points%20That%20Intersect%20With%20Cars/README.md)
diff --git a/solution/CONTEST_README_EN.md b/solution/CONTEST_README_EN.md
index df58424c8a953..7d011814c92c7 100644
--- a/solution/CONTEST_README_EN.md
+++ b/solution/CONTEST_README_EN.md
@@ -25,6 +25,13 @@ Get your rating changes right after the completion of LeetCode contests, https:/
## Past Contests
+#### Biweekly Contest 113
+
+- [2855. Minimum Right Shifts to Sort the Array](/solution/2800-2899/2855.Minimum%20Right%20Shifts%20to%20Sort%20the%20Array/README_EN.md)
+- [2856. Minimum Array Length After Pair Removals](/solution/2800-2899/2856.Minimum%20Array%20Length%20After%20Pair%20Removals/README_EN.md)
+- [2857. Count Pairs of Points With Distance k](/solution/2800-2899/2857.Count%20Pairs%20of%20Points%20With%20Distance%20k/README_EN.md)
+- [2858. Minimum Edge Reversals So Every Node Is Reachable](/solution/2800-2899/2858.Minimum%20Edge%20Reversals%20So%20Every%20Node%20Is%20Reachable/README_EN.md)
+
#### Weekly Contest 362
- [2848. Points That Intersect With Cars](/solution/2800-2899/2848.Points%20That%20Intersect%20With%20Cars/README_EN.md)
diff --git a/solution/README.md b/solution/README.md
index ed178e648a86b..e65182ff5a604 100644
--- a/solution/README.md
+++ b/solution/README.md
@@ -2865,6 +2865,10 @@
| 2852 | [Sum of Remoteness of All Cells](/solution/2800-2899/2852.Sum%20of%20Remoteness%20of%20All%20Cells/README.md) | | 中等 | 🔒 |
| 2853 | [Highest Salaries Difference](/solution/2800-2899/2853.Highest%20Salaries%20Difference/README.md) | | 简单 | 🔒 |
| 2854 | [Rolling Average Steps](/solution/2800-2899/2854.Rolling%20Average%20Steps/README.md) | | 中等 | 🔒 |
+| 2855 | [使数组成为递增数组的最少右移次数](/solution/2800-2899/2855.Minimum%20Right%20Shifts%20to%20Sort%20the%20Array/README.md) | | 简单 | 第 113 场双周赛 |
+| 2856 | [删除数对后的最小数组长度](/solution/2800-2899/2856.Minimum%20Array%20Length%20After%20Pair%20Removals/README.md) | | 中等 | 第 113 场双周赛 |
+| 2857 | [统计距离为 k 的点对](/solution/2800-2899/2857.Count%20Pairs%20of%20Points%20With%20Distance%20k/README.md) | | 中等 | 第 113 场双周赛 |
+| 2858 | [可以到达每一个节点的最少边反转次数](/solution/2800-2899/2858.Minimum%20Edge%20Reversals%20So%20Every%20Node%20Is%20Reachable/README.md) | | 困难 | 第 113 场双周赛 |
## 版权
diff --git a/solution/README_EN.md b/solution/README_EN.md
index bfc691f0e8f1b..38d6bfbc0a09c 100644
--- a/solution/README_EN.md
+++ b/solution/README_EN.md
@@ -2863,6 +2863,10 @@ Press Control+F(or Command+F on the
| 2852 | [Sum of Remoteness of All Cells](/solution/2800-2899/2852.Sum%20of%20Remoteness%20of%20All%20Cells/README_EN.md) | | Medium | 🔒 |
| 2853 | [Highest Salaries Difference](/solution/2800-2899/2853.Highest%20Salaries%20Difference/README_EN.md) | | Easy | 🔒 |
| 2854 | [Rolling Average Steps](/solution/2800-2899/2854.Rolling%20Average%20Steps/README_EN.md) | | Medium | 🔒 |
+| 2855 | [Minimum Right Shifts to Sort the Array](/solution/2800-2899/2855.Minimum%20Right%20Shifts%20to%20Sort%20the%20Array/README_EN.md) | | Easy | Biweekly Contest 113 |
+| 2856 | [Minimum Array Length After Pair Removals](/solution/2800-2899/2856.Minimum%20Array%20Length%20After%20Pair%20Removals/README_EN.md) | | Medium | Biweekly Contest 113 |
+| 2857 | [Count Pairs of Points With Distance k](/solution/2800-2899/2857.Count%20Pairs%20of%20Points%20With%20Distance%20k/README_EN.md) | | Medium | Biweekly Contest 113 |
+| 2858 | [Minimum Edge Reversals So Every Node Is Reachable](/solution/2800-2899/2858.Minimum%20Edge%20Reversals%20So%20Every%20Node%20Is%20Reachable/README_EN.md) | | Hard | Biweekly Contest 113 |
## Copyright
diff --git a/solution/summary.md b/solution/summary.md
index 18d838387b24b..7bdedad7ca7b6 100644
--- a/solution/summary.md
+++ b/solution/summary.md
@@ -2910,3 +2910,7 @@
- [2852.Sum of Remoteness of All Cells](/solution/2800-2899/2852.Sum%20of%20Remoteness%20of%20All%20Cells/README.md)
- [2853.Highest Salaries Difference](/solution/2800-2899/2853.Highest%20Salaries%20Difference/README.md)
- [2854.Rolling Average Steps](/solution/2800-2899/2854.Rolling%20Average%20Steps/README.md)
+ - [2855.使数组成为递增数组的最少右移次数](/solution/2800-2899/2855.Minimum%20Right%20Shifts%20to%20Sort%20the%20Array/README.md)
+ - [2856.删除数对后的最小数组长度](/solution/2800-2899/2856.Minimum%20Array%20Length%20After%20Pair%20Removals/README.md)
+ - [2857.统计距离为 k 的点对](/solution/2800-2899/2857.Count%20Pairs%20of%20Points%20With%20Distance%20k/README.md)
+ - [2858.可以到达每一个节点的最少边反转次数](/solution/2800-2899/2858.Minimum%20Edge%20Reversals%20So%20Every%20Node%20Is%20Reachable/README.md)
diff --git a/solution/summary_en.md b/solution/summary_en.md
index ada48850ef5e3..b854fc88ccc12 100644
--- a/solution/summary_en.md
+++ b/solution/summary_en.md
@@ -2910,3 +2910,7 @@
- [2852.Sum of Remoteness of All Cells](/solution/2800-2899/2852.Sum%20of%20Remoteness%20of%20All%20Cells/README_EN.md)
- [2853.Highest Salaries Difference](/solution/2800-2899/2853.Highest%20Salaries%20Difference/README_EN.md)
- [2854.Rolling Average Steps](/solution/2800-2899/2854.Rolling%20Average%20Steps/README_EN.md)
+ - [2855.Minimum Right Shifts to Sort the Array](/solution/2800-2899/2855.Minimum%20Right%20Shifts%20to%20Sort%20the%20Array/README_EN.md)
+ - [2856.Minimum Array Length After Pair Removals](/solution/2800-2899/2856.Minimum%20Array%20Length%20After%20Pair%20Removals/README_EN.md)
+ - [2857.Count Pairs of Points With Distance k](/solution/2800-2899/2857.Count%20Pairs%20of%20Points%20With%20Distance%20k/README_EN.md)
+ - [2858.Minimum Edge Reversals So Every Node Is Reachable](/solution/2800-2899/2858.Minimum%20Edge%20Reversals%20So%20Every%20Node%20Is%20Reachable/README_EN.md)