class Solution: def countAndSay(self, n: int) -> str: seq = "1" for i in range(n-1): seq = self.getNext(seq) return seq def getNext(self, seq): i, next_seq = 0, '' while i < len(seq): count = 1 while i+1
本文共 337 字,大约阅读时间需要 1 分钟。
class Solution: def countAndSay(self, n: int) -> str: seq = "1" for i in range(n-1): seq = self.getNext(seq) return seq def getNext(self, seq): i, next_seq = 0, '' while i < len(seq): count = 1 while i+1
转载于:https://www.cnblogs.com/WJZheng/p/11401928.html