Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit efa4ee3

Browse files
20201003
1 parent fc7503b commit efa4ee3

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

‎.vscode/settings.json‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,17 @@
1515
"editorError.foreground": "#00000000",
1616
"editorWarning.foreground": "#00000000",
1717
"editorInfo.foreground": "#00000000"
18-
}
19-
}
18+
},
19+
"[go]": {
20+
"editor.insertSpaces": true,
21+
"editor.tabSize": 4,
22+
"editor.formatOnSave": false
23+
},
24+
"go.useLanguageServer": true,
25+
"go.toolsEnvVars": {
26+
"GO111MODULE": "on",
27+
"GOPROXY": "https://goproxy.io",
28+
},
29+
"go.docsTool": "gogetdoc",
30+
"go.lintOnSave": "off"
31+
}

‎Go/547.friend-circles.go‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@
66

77
// @lc code=start
88
func findCircleNum(M [][]int) int {
9-
visited := map[int]bool{}
10-
count := 0
9+
visited := map[int]bool{}
10+
count := 0
1111

12-
for i := 0; i < len(M); i++ {
13-
if !visited[i] {
14-
count++
15-
dfs(M, visited, i)
16-
}
17-
}
18-
return count
12+
for i := 0; i < len(M); i++ {
13+
if !visited[i] {
14+
count++
15+
dfs(M, visited, i)
16+
}
17+
}
18+
return count
1919
}
2020

2121
func dfs(M [][]int, visited map[int]bool, pos int) {
22-
if visited[pos] {
23-
return
24-
}
25-
visited[pos] = true
26-
for next, val := range M[pos] {
27-
if val == 1 && !visited[next] {
28-
dfs(M, visited, next)
29-
}
30-
}
22+
if visited[pos] {
23+
return
24+
}
25+
visited[pos] = true
26+
for next, val := range M[pos] {
27+
if val == 1 && !visited[next] {
28+
dfs(M, visited, next)
29+
}
30+
}
3131
}
3232

3333
// @lc code=end

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /