Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ compress
Function
compress
javascript/0261-graph-valid-tree.js:125–125 ·
view source on GitHub ↗
(union, i, head)
Source
from the content-addressed store, hash-verified
123
};
124
125
const
compress = (union, i, head) => (union[i] = head);
126
127
const
find = (union, i, num = union[i]) => {
128
const
isEmpty = num === -1;
Callers
2
validTree
Function · 0.85
find
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected