-
Notifications
You must be signed in to change notification settings - Fork 0
ZDawang/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
#!/usr/bin/python # -*- coding: utf-8 -*- #author : zhangdawang #data: 2018-3 #difficulty degree: #problem: #time_complecity: #space_complecity: #beats: class Solution(object): def licenseKeyFormatting(self, S, K): stack, res = [], "" for c in S.upper(): if c == "-": continue stack.append(c) while stack: i = 0 while i < K and stack: res = stack.pop() + res i += 1 res = "-" + res return res[1:]
About
leetcode代码 语言:python
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published