Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dbffac2 commit 61ee224Copy full SHA for 61ee224
1 file changed
Sorts/test/FindSecondLargestElement.test.js
@@ -0,0 +1,13 @@
1
+import { secondLargestElement } from '../FindSecondLargestElement'
2
+
3
+test('The second largest element of the array [1, 2, 3, 4, 5] is 4', () => {
4
+ const array = [1, 2, 3, 4, 5]
5
+ const res = secondLargestElement(array)
6
+ expect(res).toEqual(4)
7
+})
8
9
+test('The second largest element of the array [-1, -2, -3, -4, -5] is -2', () => {
10
+ const array = [-1, -2, -3, -4, -5]
11
12
+ expect(res).toEqual(-2)
13
0 commit comments