Skip to content

Commit ad1b86e

Browse files
authored
Remove unnecessary imports and update README.
1 parent d096762 commit ad1b86e

File tree

6 files changed

+16
-46
lines changed

6 files changed

+16
-46
lines changed

solution/3300-3399/3378.Count Connected Components in LCM Graph/README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ tags:
8282

8383
<!-- solution:start -->
8484

85-
### 方法一
85+
### 方法一:并查集
8686

8787
<!-- tabs:start -->
8888

@@ -135,8 +135,6 @@ class Solution:
135135
#### Java
136136

137137
```java
138-
import java.util.*;
139-
140138
class DSU {
141139
private Map<Integer, Integer> parent;
142140
private Map<Integer, Integer> rank;
@@ -263,12 +261,6 @@ public:
263261
#### Go
264262
265263
```go
266-
package main
267-
268-
import (
269-
"fmt"
270-
)
271-
272264
type DSU struct {
273265
parent map[int]int
274266
rank map[int]int
@@ -329,7 +321,13 @@ func countComponents(nums []int, threshold int) int {
329321
}
330322
```
331323

332-
### Solution 2 (DFS)
324+
<!-- tabs:end -->
325+
326+
<!-- solution:end -->
327+
328+
<!-- solution:start -->
329+
330+
### 方法二:DFS
333331

334332
<!-- tabs:start -->
335333

@@ -368,8 +366,6 @@ class Solution:
368366
#### Java
369367

370368
```java
371-
import java.util.*;
372-
373369
class Solution {
374370
private void dfs(int node, List<List<Integer>> adj, boolean[] visited) {
375371
if (visited[node]) return;
@@ -452,10 +448,6 @@ public:
452448
#### Go
453449
454450
```go
455-
package main
456-
457-
import "fmt"
458-
459451
func dfs(node int, adj [][]int, visited []bool) {
460452
if visited[node] {
461453
return

solution/3300-3399/3378.Count Connected Components in LCM Graph/README_EN.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ tags:
7979

8080
<!-- solution:start -->
8181

82-
### Solution 1 (DSU)
82+
### Solution 1: Union Find
8383

8484
<!-- tabs:start -->
8585

@@ -132,8 +132,6 @@ class Solution:
132132
#### Java
133133

134134
```java
135-
import java.util.*;
136-
137135
class DSU {
138136
private Map<Integer, Integer> parent;
139137
private Map<Integer, Integer> rank;
@@ -260,12 +258,6 @@ public:
260258
#### Go
261259
262260
```go
263-
package main
264-
265-
import (
266-
"fmt"
267-
)
268-
269261
type DSU struct {
270262
parent map[int]int
271263
rank map[int]int
@@ -326,7 +318,13 @@ func countComponents(nums []int, threshold int) int {
326318
}
327319
```
328320

329-
### Solution 2 (DFS)
321+
<!-- tabs:end -->
322+
323+
<!-- solution:end -->
324+
325+
<!-- solution:start -->
326+
327+
### Solution 2: DFS
330328

331329
<!-- tabs:start -->
332330

@@ -365,8 +363,6 @@ class Solution:
365363
#### Java
366364

367365
```java
368-
import java.util.*;
369-
370366
class Solution {
371367
private void dfs(int node, List<List<Integer>> adj, boolean[] visited) {
372368
if (visited[node]) return;
@@ -449,10 +445,6 @@ public:
449445
#### Go
450446
451447
```go
452-
package main
453-
454-
import "fmt"
455-
456448
func dfs(node int, adj [][]int, visited []bool) {
457449
if visited[node] {
458450
return

solution/3300-3399/3378.Count Connected Components in LCM Graph/Solution.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
package main
2-
3-
import (
4-
"fmt"
5-
)
6-
71
type DSU struct {
82
parent map[int]int
93
rank map[int]int

solution/3300-3399/3378.Count Connected Components in LCM Graph/Solution.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import java.util.*;
2-
31
class DSU {
42
private Map<Integer, Integer> parent;
53
private Map<Integer, Integer> rank;

solution/3300-3399/3378.Count Connected Components in LCM Graph/Solution2.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
package main
2-
3-
import "fmt"
4-
51
func dfs(node int, adj [][]int, visited []bool) {
62
if visited[node] {
73
return

solution/3300-3399/3378.Count Connected Components in LCM Graph/Solution2.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import java.util.*;
2-
31
class Solution {
42
private void dfs(int node, List<List<Integer>> adj, boolean[] visited) {
53
if (visited[node]) return;

0 commit comments

Comments
 (0)