Skip to content

Commit e7b9cab

Browse files
committed
fix: update java code
1 parent d945f3c commit e7b9cab

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

solution/0700-0799/0721.Accounts Merge/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ class Solution {
179179
Map<Integer, Set<String>> g = new HashMap<>();
180180
for (int i = 0; i < n; ++i) {
181181
int root = uf.find(i);
182-
g.computeIfAbsent(root, k -> new HashSet<>()).addAll(accounts.get(i).subList(1, accounts.get(i).size()));
182+
g.computeIfAbsent(root, k -> new HashSet<>())
183+
.addAll(accounts.get(i).subList(1, accounts.get(i).size()));
183184
}
184185
List<List<String>> ans = new ArrayList<>();
185186
for (var e : g.entrySet()) {

solution/0700-0799/0721.Accounts Merge/README_EN.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ class Solution {
177177
Map<Integer, Set<String>> g = new HashMap<>();
178178
for (int i = 0; i < n; ++i) {
179179
int root = uf.find(i);
180-
g.computeIfAbsent(root, k -> new HashSet<>()).addAll(accounts.get(i).subList(1, accounts.get(i).size()));
180+
g.computeIfAbsent(root, k -> new HashSet<>())
181+
.addAll(accounts.get(i).subList(1, accounts.get(i).size()));
181182
}
182183
List<List<String>> ans = new ArrayList<>();
183184
for (var e : g.entrySet()) {

solution/0700-0799/0721.Accounts Merge/Solution.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ public List<List<String>> accountsMerge(List<List<String>> accounts) {
5252
Map<Integer, Set<String>> g = new HashMap<>();
5353
for (int i = 0; i < n; ++i) {
5454
int root = uf.find(i);
55-
g.computeIfAbsent(root, k -> new HashSet<>()).addAll(accounts.get(i).subList(1, accounts.get(i).size()));
55+
g.computeIfAbsent(root, k -> new HashSet<>())
56+
.addAll(accounts.get(i).subList(1, accounts.get(i).size()));
5657
}
5758
List<List<String>> ans = new ArrayList<>();
5859
for (var e : g.entrySet()) {

0 commit comments

Comments
 (0)