Skip to content

Commit 8deb3aa

Browse files
committed
[REFACTOR] [Hacker Rank] Interview Preparation Kit: Recursion: Recursive Digit Sum.
* Adjusted the interface to match what hackerrank expects.
1 parent 9b317ff commit 8deb3aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hackerrank/interview_preparation_kit/recursion_and_backtracking/recursive_digit_sum.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
const RADIX = 10;
66

7-
export function superDigitCompute(n) {
7+
function superDigitCompute(n) {
88
if (n.length === 1) {
99
return parseInt(n, RADIX);
1010
}
@@ -17,7 +17,7 @@ export function superDigitCompute(n) {
1717
return superDigitCompute(`${partial}`);
1818
}
1919

20-
export function superDigit(n, k) {
20+
function superDigit(n, k) {
2121
const accumulator = `${superDigitCompute(n)}`;
2222

2323
let result = '';
@@ -29,3 +29,4 @@ export function superDigit(n, k) {
2929
}
3030

3131
export default { superDigit };
32+
export { superDigit };

0 commit comments

Comments
 (0)