- Notifications
You must be signed in to change notification settings - Fork 89
License
Notifications You must be signed in to change notification settings
yingl/LintCodeInPython
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Latest commit | ||||
Repository files navigation
class Solution: """ @param S: a string @param K: a integer @return: return a string """ def licenseKeyFormatting(self, S, K): # write your code here ret = [] count = 0 for i in range(len(S) - 1, -1, -1): if S[i] != '-': count += 1 ret.append(S[i].upper()) if (count % K) == 0: ret.append('-') if ret[-1] == '-': ret.pop() ret.reverse() return ''.join(ret) # easy: https://www.lintcode.com/problem/license-key-formatting/About
No description, website, or topics provided.
License
Uh oh!
There was an error while loading. Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Uh oh!
There was an error while loading. Please reload this page.