MCPcopy Create free account
hub / github.com/ByteByteGoHq/coding-interview-patterns / find

Method find

kotlin/Graphs/ConnectTheDots.kt:23–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 }
22
23 fun find(x: Int): Int {
24 if (x == parent[x]) {
25 return x
26 }
27 parent[x] = find(parent[x])
28 return parent[x]
29 }
30}
31
32fun connectTheDots(points: List<List<Int>>): Int {

Callers 15

kSumSubarraysOptimizedFunction · 0.45
zeroStripingHashSetsFunction · 0.45
pairSumUnsortedTwoPassFunction · 0.45
verifySudokuBoardFunction · 0.45
pairSumUnsortedFunction · 0.45
getMethod · 0.45
putMethod · 0.45
exploreLevelFunction · 0.45

Calls

no outgoing calls

Tested by 3

exploreLevelFunction · 0.36