Skip to content

Commit

Permalink
Merge pull request #55 from shoonia/shoonia-patch-1
Browse files Browse the repository at this point in the history
Update index.js
  • Loading branch information
shoonia committed May 4, 2024
2 parents ad252d7 + 8169715 commit 75f259f
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 75f259f

Please sign in to comment.