We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d13cccd commit ddeb040Copy full SHA for ddeb040
Data-Structures/Array/test/LocalMaximomPoint.test.js
@@ -26,13 +26,15 @@ describe('LocalMaximumPoint tests', () => {
26
expect(LocalMaximomPoint(Array2)).toEqual(3)
27
})
28
29
- it('test with positive and negative numbers', () => {
30
- const Array2 = [-4, -3, -2, -1, -5, 4, -1]
31
- expect(LocalMaximomPoint(Array2)).toEqual(3)
+ it('test inner points - repeated local maxima', () => {
+ const Array2 = [1, 5, 5, 5, 3, 2, 1]
+ const result = LocalMaximomPoint(Array2)
32
+ expect([1, 2, 3]).toContain(result)
33
34
- it('test with floating-point numbers', () => {
35
- const Array2 = [1.5, 3.5, 2.5, 0.5, -1.5, -3.5, -2.5]
36
- expect(LocalMaximomPoint(Array2)).toEqual(1)
+ it('test inner points - alternating peaks and valleys', () => {
+ const Array2 = [1, 3, 2, 4, 3, 5, 4]
37
38
+ expect([1, 3, 5]).toContain(result)
39
40
0 commit comments