MCPcopy 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
22const canPush = (path) =>
23 !(isCurrentDirectory(path) || isParentDirectory(path));
24
25const canPop = (path, stack) => isParentDirectory(path) && !isEmpty(stack);
26

Callers 1

traversePathFunction · 0.85

Calls 2

isCurrentDirectoryFunction · 0.85
isParentDirectoryFunction · 0.85

Tested by

no test coverage detected