Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ canPush
Function
canPush
javascript/0071-simplify-path.js:22–23 ·
view source on GitHub ↗
(path)
Source
from the content-addressed store, hash-verified
20
};
21
22
const
canPush = (path) =>
23
!(isCurrentDirectory(path) || isParentDirectory(path));
24
25
const
canPop = (path, stack) => isParentDirectory(path) && !isEmpty(stack);
26
Callers
1
traversePath
Function · 0.85
Calls
2
isCurrentDirectory
Function · 0.85
isParentDirectory
Function · 0.85
Tested by
no test coverage detected