Permalink
Không thể lấy lại những người đóng góp tại thời điểm này
Tệp này chứa văn bản unicode hai chiều có thể được giải thích hoặc biên dịch khác với những gì xuất hiện dưới đây. Để xem xét, hãy mở tệp trong một trình soạn thảo cho thấy các ký tự Unicode ẩn. Tìm hiểu thêm về các ký tự unicode hai chiều
def palindrom [a]: | |
Nếu Len [A]> 2: | |
B = A [::-1] | |
t = "". Tham gia [a] | |
g = "". Tham gia [b] | |
Nếu t == g: | |
Trả lại 1 | |
khác: | |
trả lại 0 | |
khác: | |
trả lại 0 | |
khác: | |
A = list [input []. Dải []] | |
S = 0 | |
Đối với tôi trong phạm vi [Len [A]]: | |
Đối với J trong phạm vi [i, len [a] +1]: | |
m = palindrom [A [i: j]] | |
Nếu m == true: | |
S = S+1 |
{
83
5
9 int
13__
countPalindromes[string s]
9 Examples:
Input : str = "abaab"
Output: 3
Explanation :
All palindrome substring are :
"aba", "aa", "baab"
Input : str = "abbaeae"
Output: 4
Explanation :
All palindrome substring are :
"bb", "abba", "aea", "eae":
55
{
83
5
9
Examples: Input : str = "abaab" Output: 3 Explanation : All palindrome substring are : "aba", "aa", "baab" Input : str = "abbaeae" Output: 4 Explanation : All palindrome substring are : "bb", "abba", "aea", "eae":61
43{
88
45everest
Output:
2
Explanation:
The sub palindromes are eve, ere.
#include
#include
int main[]
{
char str[1000];
int res=0;
scanf["%s",str];
for[int i=0;i