Skip to content

Commit 45d5536

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] [Hacker Rank] Interview Preparation Kit: Array: 2D Array - DS. Test cases added.
1 parent 6c0875d commit 45d5536

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/hackerrank/interview_preparation_kit/arrays/2d_array.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import TEST_CASES from './2d_array.testcases_test.json';
66

77
describe('arrays: 2d Array hourglassSum', () => {
88
it('hourglassSum Test Cases', () => {
9-
expect.assertions(1);
9+
expect.assertions(3);
1010

1111
TEST_CASES.forEach((test) => {
1212
const answer = hourglassSum(test.input);

src/hackerrank/interview_preparation_kit/arrays/2d_array.testcases_test.json

+24
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,29 @@
1010
[0, 0, 1, 2, 4, 0]
1111
],
1212
"expected": 19
13+
},
14+
{
15+
"title": "Sample Test Case 1",
16+
"input": [
17+
[1, 1, 1, 0, 0, 0],
18+
[0, 1, 0, 0, 0, 0],
19+
[1, 1, 1, 0, 0, 0],
20+
[0, 9, 2, -4, -4, 0],
21+
[0, 0, 0, -2, 0, 0],
22+
[0, 0, -1, -2, -4, 0]
23+
],
24+
"expected": 13
25+
},
26+
{
27+
"title": "Sample Test Case 2",
28+
"input": [
29+
[-9, -9, -9, 1, 1, 1],
30+
[0, -9, 0, 4, 3, 2],
31+
[-9, -9, -9, 1, 2, 3],
32+
[0, 0, 8, 6, 6, 0],
33+
[0, 0, 0, -2, 0, 0],
34+
[0, 0, 1, 2, 4, 0]
35+
],
36+
"expected": 28
1337
}
1438
]

0 commit comments

Comments
 (0)