Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
32
fun connectTheDots(points: List<List<Int>>): Int {
Callers
15
longestSubstringWithUniqueCharsOptimized
Function · 0.45
longestSubstringWithUniqueChars
Function · 0.45
kSumSubarraysOptimized
Function · 0.45
zeroStripingHashSets
Function · 0.45
pairSumUnsortedTwoPass
Function · 0.45
longestChainOfConsecutiveNumbers
Function · 0.45
verifySudokuBoard
Function · 0.45
pairSumUnsorted
Function · 0.45
get
Method · 0.45
put
Method · 0.45
shortestTransformationSequenceOptimized
Function · 0.45
exploreLevel
Function · 0.45
Calls
no outgoing calls
Tested by
3
shortestTransformationSequenceOptimized
Function · 0.36
exploreLevel
Function · 0.36
shortestTransformationSequence
Function · 0.36