Skip to content

Commit

Permalink
Update leetcode.js
Browse files Browse the repository at this point in the history
  • Loading branch information
QasimWani authored Oct 9, 2022
1 parent 15320ac commit 55eb480
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/leetcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,9 @@ function getProblemNameSlug() {
}

function addLeadingZeros(title) {
const maxTitlePrefixLength = 4;
var len = title.split('-')[0].length;
if (len < 4) {
if (len < maxTitlePrefixLength) {
return '0'.repeat(4 - len) + title;
}
return title;
Expand Down

0 comments on commit 55eb480

Please sign in to comment.