Problem
Java
union–find
© 1.5 Case Study: Union-Find Copyright © 2000–2019 Robert Sedgewick and Kevin Wayne. All rights reserved.
1 | class Solution { |
Submission Detail
- 113 / 113 test cases passed.
- Runtime: 1 ms, faster than 72.63% of Java online submissions for Friend Circles.
- Memory Usage: 40.3 MB, less than 68.00% of Java online submissions for Friend Circles.
Depth-first search
1 | class Solution { |
Submission Detail
- 113 / 113 test cases passed.
- Runtime: 4 ms, faster than 25.38% of Java online submissions for Friend Circles.
- Memory Usage: 40.1 MB, less than 72.00% of Java online submissions for Friend Circles.