Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/careercup/CtCI-6th-Edition-JavaScript
/ peek
Function
peek
chapter02/2.7 - Intersection/intersection.js:3–5 ·
view source on GitHub ↗
(stack)
Source
from the content-addressed store, hash-verified
1
var
LinkedList = require(
'./../util/LinkedList'
);
2
3
var
peek =
function
(stack) {
4
return
stack[stack.length - 1];
5
};
6
7
var
intersection =
function
(head1, head2) {
8
var
stack1 = [];
Callers
1
intersection
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected