Skip to content

Commit 7db2bcb

Browse files
committed
[REFACTOR] [REFACTOR] [Hacker Rank] Interview Preparation Kit: Dictionaries and Hashmaps: Count Triplets.
* Adjusted the interface to match what hackerrank expects.
1 parent b83d3d0 commit 7db2bcb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/count_triplets_1_bruteforce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import { logger as console } from '../../../logger.js';
66

7-
export function countTriplets(arr, ratio) {
7+
function countTriplets(arr, ratio) {
88
const size = arr.length;
99
let counter = 0;
1010

src/hackerrank/interview_preparation_kit/dictionaries_and_hashmaps/count_triplets_1_bruteforce.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, it } from '@jest/globals';
22
import { logger as console } from '../../../logger.js';
33

4-
import { countTriplets } from './count_triplets_1_bruteforce.js';
4+
import countTriplets from './count_triplets_1_bruteforce.js';
55

66
import SMALL_TEST_CASES from './count_triplets_1.small.testcases.json';
77

@@ -10,7 +10,7 @@ describe('count_triplets_1', () => {
1010
expect.assertions(4);
1111

1212
SMALL_TEST_CASES.forEach((test) => {
13-
const answer = countTriplets(test.input, test.r);
13+
const answer = countTriplets.countTriplets(test.input, test.r);
1414

1515
console.debug(
1616
`countTriplets(${test.input}, ${test.r}) solution found: ${answer}`

0 commit comments

Comments
 (0)