Skip to content

Commit 9b317ff

Browse files
committed
[REFACTOR] [Hacker Rank] Interview Preparation Kit: Recursion: Davis' Staircase.
* Adjusted the interface to match what hackerrank expects.
1 parent b7d966d commit 9b317ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hackerrank/interview_preparation_kit/recursion_and_backtracking/ctci_recursive_staircase.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const TOP_LIMIT = 10 ** 10 + 7;
77
const STEPSLIMIT = 3;
88

9-
export class StepPerms {
9+
class StepPerms {
1010
TOP_LIMIT = 1;
1111

1212
STEPS_LIMIT = 1;
@@ -39,10 +39,11 @@ export class StepPerms {
3939
}
4040
}
4141

42-
export function stepPerms(n) {
42+
function stepPerms(n) {
4343
const stairs = new StepPerms(TOP_LIMIT, STEPSLIMIT);
4444

4545
return stairs.stepPermsComputWithCache(n) % TOP_LIMIT;
4646
}
4747

4848
export default { stepPerms, StepPerms };
49+
export { stepPerms, StepPerms };

0 commit comments

Comments
 (0)