Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
shoonia authored May 4, 2024
1 parent ad252d7 commit 8169715
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@
const increment = (acc, index, start, end) => {
if (acc.length === index) {
acc.push(0);
return;
}

if (acc[index] < start) {
} else if (acc[index] < start) {
++acc[index];
return;
} else {
acc[index] = 0;
increment(acc, ++index, end, end);
}

acc[index] = 0;

return increment(acc, ++index, end, end);
};

/**
Expand Down

0 comments on commit 8169715

Please sign in to comment.