-
Notifications
You must be signed in to change notification settings - Fork 0
My accepted leetcode submissions
ayushthoren/leetcode
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
class Solution:
def licenseKeyFormatting(self, s: str, k: int) -> str:
s = s.replace("-", "").upper(); l = len(s)
f = l % k or k; n = [s[:f]]
for i in range(f, l, k): n.append(s[i:i+k])
return "-".join(n)
About
My accepted leetcode submissions