-
Notifications
You must be signed in to change notification settings - Fork 0
License
OlegGasul/Leetcode
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
def licenseKeyFormatting(s: str, k: int) -> str: word = ''.join(s.split('-')) result = [] i = len(word) while i > 0: result.insert(0, word[max(i - k, 0) : i].upper()) i -= k return '-'.join(result) print(licenseKeyFormatting("5F3Z-2e-9-w", 4)) print(licenseKeyFormatting("2-5g-3-J", 2))
About
No description, website, or topics provided.
License
Stars
Watchers
Forks
Releases
No releases published