forked from everthis/leetcode-js
-
Notifications
You must be signed in to change notification settings - Fork 0
1000+ javascript solutions of leetcode problems.
License
VigneshSwamy/leetcode-js
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Sorry, we had to truncate this directory to 1,000 files. 393 entries were omitted from the list. | ||||
Repository files navigation
/**
* @param {string} S
* @param {number} K
* @return {string}
*/
const licenseKeyFormatting = function(S, K) {
if (S == null || S === "") return "";
const newStr = S.replace(/-/g, "").toUpperCase();
const arr = newStr.split("");
for (let i = arr.length - 1 - K; i >= 0; i -= K) {
arr[i] = arr[i] + "-";
}
return arr.join("");
};
About
1000+ javascript solutions of leetcode problems.
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- JavaScript 99.9%
- Shell 0.1%