917. 反轉字符串(isalpha())

解答一:  def reverseOnlyLetters(self, S): i, j = 0, len(S) - 1 S = list(S) while i < j: while i < j and not S[i].isalpha(): i += 1 while i < j and not S[j].isalpha(): j -= 1
相關文章
相關標籤/搜索