+ 1
Why isn't it working properly??
a = input() for k in range(len(a)+1): if a[:k] == a[k::-1]: print(a[k::-1])
3 ответов
+ 4
len(a)-1
+ 1
Shahir How about this one? :-
a = input()
for i in range(len(a) - 1, -1, -1):
if a[:i+1] == a[i::-1]:
print(a[:i+1])
break
# Hope this
0
Given a string s, return the longest palindromic substring in s
Input: s = "babad"
Output: "bab"
Note: "aba" is also a valid answer