将给出字符串的问号转换成字符小写字母,使其满足回文要求 | python面试题笔试题 | python 技术论坛-大发黄金版app下载
write a function solution that,given a string s of length n,returns any palindrome which can be obtained by replacing all of
the question marks in s by lowercase letters (‘a’-‘z).if no
palindrome can be obtained,the function should return the string
“no”.
a palindrome is a string that reads the same both forwards and
backwards.some examples of palindromes are:”kayak”,”radar”,
“mom”.
examples:
1.given s=”?ab??a”,the function should return “aabbaa”.
2.given s=”bab??a”,the function should return “no”.
3.given s=”?a?”,the function may return “aaa”.it may also
return “zaz”,among other possible answers.
tes
assume that:
·n is an integer within the range[1.1,000];
·string s consists only of lowercases letters(‘a’-
‘z)or’?.
这是特斯拉面试题,我挂在这道题上了;发给小伙伴看看,如何大家之后碰到希望可以解决
写的有点丑陋...我可能还没测全... 懒得改了 先午睡
这里人很少啊,只有一个题?