Problem: A string S of an odd length is said to be a _strong palindrome_ if and only if all of the following conditions are satisfied:    * S is a palindrome.   * Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.   * The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.  Determine whether S is a strong palindrome.

Submission attempts (in order):

S = input()

S_list = list(S)

counter = 0
counter_ = 0
counter__ = 0


for i in range(int(len(S_list)/2)):
    if(S_list[i]==S_list[i+int(len(S_list)/2)+1]):
        counter = counter + 1
    else:
        counter = counter
if(counter != int(len(S_list)/2)):
    print("No")
    
    
else:
    for i in range(int(len(S_list)/4)):
        if(S_list[i]==S_list[i+int(len(S_list)/4)+1]):
            counter_ = counter_ + 1
        else:
            counter_ = counter_
    if(counter_ != int(len(S_list)/4)):
        print("No")
        
        
    else:
        for i in range(int(len(S_list)/4)):
            print(i+int(len(S_list)/2)+1,S_list[i+int(len(S_list)/2)+1],i+int(len(S_list)/2)+1+int(len(S_list)/4),S_list[i+int(len(S_list)/2)+1+int(len(S_list)/4)+1])
            if(S_list[i+int(len(S_list)/2)+1]==S_list[i+int(len(S_list)/2)+1+int(len(S_list)/4)+1]):
                counter__ = counter__ + 1
            else:
                counter__ = counter__
        if(counter__ != int(len(S_list)/4)):
            print("No")
        else:
            print("Yes")


S = input()

S_list = list(S)

counter = 0
for i in range(int(len(S_list)/2)):
  #print(S_list[i],S_list[i+int(len(S_list)/2)+1])
  if(S_list[i]==S_list[i+int(len(S_list)/2)+1]):
    counter = counter + 1
  else:
    counter = counter
    
#print(counter,int(len(S_list)/2))
if(counter < int(len(S_list)/2)):
    print("NO")
    
for i in range(int(len(S_list)/4)):
  if(S_list[i]==S_list[i+int(len(S_list)/4)+1]):
    #print(S_list[i],S_list[i+int(len(S_list)/4)+1])
    #print((S_list[i+int(len(S_list)/2)+1],S_list[i+int(len(S_list)/2)+int(len(S_list)/2)]))
    if(S_list[i+int(len(S_list)/2)+1]==S_list[i+int(len(S_list)/2)+int(len(S_list)/2)]):
      print("YES")


S = input()

S_list = list(S)

counter = 0
for i in range(int(len(S_list)/2)):
  if(S_list[i]==S_list[i+int(len(S_list)/2)+1]):
    counter = counter + 1
  else:
    counter = counter
    
if(counter < int(len(S_list)/2)):
    print("NO")
    
counter_ = 0
counter__ = 0
for i in range(int(len(S_list)/4)):
  if(S_list[i]==S_list[i+int(len(S_list)/4)+1]):
    counter_ = counter_ + 1
    if(S_list[i+int(len(S_list)/2)+1]==S_list[i+int(len(S_list)/2)+int(len(S_list)/2)]):
      counter__ = counter__ + 1

if((counter_ = int(len(S_list)/4))and(counter__ = int(len(S_list)/4))):
  print("Yes")


S = input()

S_list = list(S)

S_list_reverse = list(reversed(S_list))


#print(S_list_reverse)
#print(S_list)

if(S_list != S_list_reverse):
  print("No")
else:
  S_list_new = S_list
  del S_list_new[int(len(S_list)/2):]
  S_list_new_reverse =  list(reversed(S_list_new))
  if(S_list_new != S_list_new_reverse):
    print("No")
  else:
    print("Yes")

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted