摘要: class Solution: def sortSentence(self, s: str) -> str: words = s.split() li = ['']*len(words) for i in words: li[int(i[-1])-1]=i[0:-1] return " ".join 阅读全文
posted @ 2022-09-09 17:36 盗哥泡茶去了 阅读(25) 评论(0) 推荐(0) 编辑
摘要: class Solution: def sumBase(self, n: int, k: int) -> int: tag = True quotient = n//k #商 remainder = n%k #余数 while tag: if quotient >= k: remainder+=qu 阅读全文
posted @ 2022-09-09 16:06 盗哥泡茶去了 阅读(25) 评论(0) 推荐(0) 编辑
摘要: class Solution: def minOperations(self, logs: List[str]) -> int: result=0 for i in range(0,len(logs)): if logs[i]=='../': if result>0: result-=1 elif  阅读全文
posted @ 2022-09-09 15:24 盗哥泡茶去了 阅读(9) 评论(0) 推荐(0) 编辑