Passed
Push — master ( c29376...731f78 )
by Nguyen
36s queued 11s
created

topics/stack/next-greater-element/test.js   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 16
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
mnd 0
bc 0
fnc 1
dl 0
loc 16
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10
1
const NGE = require('./index.js');
2
// put your tests here
3
test('test NGE using stack', () => {
4
    expect(NGE([4, 5, 2, 25])).toEqual({
5
        4: 5,
6
        5: 25,
7
        2: 25,
8
        25: -1
9
    });
10
    expect(NGE([13, 7, 6, 12])).toEqual({
11
        13: -1,
12
        7: 12,
13
        6: 12,
14
        12: -1
15
    })
16
});