-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] JSON data load for unit tests.
- Loading branch information
Gonzalo Diaz
committed
Aug 23, 2024
1 parent
47fe250
commit df97136
Showing
18 changed files
with
246 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/hackerrank/interview_preparation_kit/arrays/ctci_array_left_rotation.testcases.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{"numbers": [1, 2, 3, 4, 5], "expected": [2, 3, 4, 5, 1]}, | ||
{"numbers": [2, 3, 4, 5, 1], "expected": [3, 4, 5, 1, 2]}, | ||
{"numbers": [3, 4, 5, 1, 2], "expected": [4, 5, 1, 2, 3]}, | ||
{"numbers": [4, 5, 1, 2, 3], "expected": [5, 1, 2, 3, 4]}, | ||
{"numbers": [5, 1, 2, 3, 4], "expected": [1, 2, 3, 4, 5]} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/hackerrank/interview_preparation_kit/arrays/minimum_swaps_2.testcases.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ | ||
{"title": "Sample input 0", "input": [4, 3, 1, 2], "expected": 3}, | ||
{"title": "Sample input 1", "input": [2, 3, 4, 1, 5], "expected": 3}, | ||
{"title": "Sample input 2", "input": [1, 3, 5, 2, 4, 6, 7], "expected": 3} | ||
] |
18 changes: 2 additions & 16 deletions
18
src/hackerrank/interview_preparation_kit/arrays/new_year_chaos.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/hackerrank/interview_preparation_kit/arrays/new_year_chaos.testcases.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[ | ||
{ | ||
"title": "Test Case 0-0", | ||
"input": [2, 1, 5, 3, 4], | ||
"expected": 3 | ||
}, | ||
{ | ||
"title": "Test Case 0-1", | ||
"input": [2, 5, 1, 3, 4], | ||
"expected": "Too chaotic" | ||
}, | ||
{ | ||
"title": "Test Case 1-1", | ||
"input": [5, 1, 2, 3, 7, 8, 6, 4], | ||
"expected": "Too chaotic" | ||
}, | ||
{ | ||
"title": "Test Case 1-2", | ||
"input": [1, 2, 5, 3, 7, 8, 6, 4], | ||
"expected": 7 | ||
}, | ||
{ | ||
"title": "Test Case 2", | ||
"input": [1, 2, 5, 3, 4, 7, 8, 6], | ||
"expected": 4 | ||
} | ||
] |
12 changes: 12 additions & 0 deletions
12
...k/interview_preparation_kit/dictionaries_and_hashmaps/count_triplets_1.big.testcases.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"title": "Sample Test Case 2", | ||
"input": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | ||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | ||
"r": 1, | ||
"expected": 161700 | ||
} | ||
] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...rrank/interview_preparation_kit/dictionaries_and_hashmaps/ctci-ransom-note.testcases.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
{ | ||
"title": "Sample Test Case 0", | ||
"magazine": ["give", "me", "one", "grand", "today", "night"], | ||
"note": ["give", "one", "grand", "today"], | ||
"expected": "Yes" | ||
}, | ||
{ | ||
"title": "Sample Test Case 1", | ||
"magazine": ["two", "times", "three", "is", "not", "four"], | ||
"note": ["two", "times", "two", "is", "four"], | ||
"expected": "No" | ||
}, | ||
{ | ||
"title": "Sample Test", | ||
"magazine": ["two", "two", "times", "three", "is", "not", "four"], | ||
"note": ["two", "times", "two", "is", "four"], | ||
"expected": "Yes" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/two_strings.testcases.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[ | ||
{ | ||
"title": "Example 1 and 2", | ||
"test": [ | ||
{ | ||
"s1": "and", | ||
"s2": "art", | ||
"expected": "YES" | ||
}, | ||
{ | ||
"s1": "be", | ||
"s2": "cat", | ||
"expected": "NO" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Sample Test Case 0", | ||
"test": [ | ||
{ | ||
"s1": "hello", | ||
"s2": "world", | ||
"expected": "YES" | ||
}, | ||
{ | ||
"s1": "hi", | ||
"s2": "world", | ||
"expected": "NO" | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Sample Test Case 6", | ||
"test": [ | ||
{ | ||
"s1": "wouldyoulikefries", | ||
"s2": "abcabcabcabcabcabc", | ||
"expected": "NO" | ||
}, | ||
{ | ||
"s1": "hackerrankcommunity", | ||
"s2": "cdecdecdecde", | ||
"expected": "YES" | ||
}, | ||
{ | ||
"s1": "jackandjill", | ||
"s2": "wentupthehill", | ||
"expected": "YES" | ||
}, | ||
{ | ||
"s1": "writetoyourparents", | ||
"s2": "fghmqzldbc", | ||
"expected": "NO" | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.