class Solution:
def modifyString(self, s: str) -> str:
while s.find('?')!=-1:
t='a'
tmp=ord(t)
if len(s)==1:
return 'a'
if s.find('?')==0:
while t==s[s.find('?')+1]:
tmp+=1
t=chr(tmp)
if s.find('?')==len(s)-1:
while t==s[s.find('?')-1]:
tmp+=1
t=chr(tmp)
else:
while t==s[s.find('?')+1] or t==s[s.find('?')-1]:
q=s[s.find('?')+1]
p=s[s.find('?')-1]
tmp+=1
t=chr(tmp)
s=s.replace("?",t,1)
return s
习惯c++直接字符+就可以增长,这里ascii 需要ord, ascii到字母需要chr