Skip to content

Commit c74960a

Browse files
committed
[REFACTOR] [Hacker Rank] Interview Preparation Kit: Hash Tables: Ice Cream Parlor.
* Adjusted the interface to match what hackerrank expects.
1 parent 8deb3aa commit c74960a

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/hackerrank/interview_preparation_kit/search/ctci_ice_cream_parlor.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @link Problem definition [[docs/hackerrank/interview_preparation_kit/search/ctci-ice-cream-parlor.md]]
33
*/
44

5-
export function whatFlavorsCompute(cost, money) {
5+
function whatFlavorsCompute(cost, money) {
66
const cache = {};
77
const RADIX = 10;
88

@@ -20,8 +20,9 @@ export function whatFlavorsCompute(cost, money) {
2020
return [];
2121
}
2222

23-
export function whatFlavors(cost, money) {
23+
function whatFlavors(cost, money) {
2424
console.log(whatFlavorsCompute(cost, money)?.join(' '));
2525
}
2626

2727
export default { whatFlavorsCompute, whatFlavors };
28+
export { whatFlavorsCompute, whatFlavors };

src/hackerrank/interview_preparation_kit/search/ctci_ice_cream_parlor_bruteforce.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @link Problem definition [[docs/hackerrank/interview_preparation_kit/search/ctci-ice-cream-parlor.md]]
33
*/
44

5-
export function whatFlavorsBruteforceCompute(cost, money) {
5+
function whatFlavorsBruteforceCompute(cost, money) {
66
const RADIX = 10;
77

88
for (const key of Object.keys(cost)) {
@@ -22,8 +22,9 @@ export function whatFlavorsBruteforceCompute(cost, money) {
2222
return [];
2323
}
2424

25-
export function whatFlavors(cost, money) {
25+
function whatFlavors(cost, money) {
2626
console.log(whatFlavorsBruteforceCompute(cost, money)?.join(' '));
2727
}
2828

2929
export default { whatFlavorsBruteforceCompute, whatFlavors };
30+
export { whatFlavorsBruteforceCompute, whatFlavors };

src/hackerrank/interview_preparation_kit/search/ctci_ice_cream_parlor_optimized.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @link Problem definition [[docs/hackerrank/interview_preparation_kit/search/ctci-ice-cream-parlor.md]]
33
*/
44

5-
export function whatFlavorsCompute(cost, money) {
5+
function whatFlavorsCompute(cost, money) {
66
let ans1;
77
let ans2;
88

@@ -44,8 +44,9 @@ export function whatFlavorsCompute(cost, money) {
4444
return Array.from(result);
4545
}
4646

47-
export function whatFlavors(cost, money) {
47+
function whatFlavors(cost, money) {
4848
console.log(whatFlavorsCompute(cost, money)?.join(' '));
4949
}
5050

5151
export default { whatFlavorsCompute, whatFlavors };
52+
export { whatFlavorsCompute, whatFlavors };

0 commit comments

Comments
 (0)