-
Notifications
You must be signed in to change notification settings - Fork 231
everthis/leetcode-js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Latest commitada3d37 · | ||||
Sorry, we had to truncate this directory to 1,000 files. 380 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
2000+ javascript solutions of leetcode problems.
Topics
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published