Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

check is symmetric python

# Kiem tra chuoi doi xung
import sys
sys.setrecursionlimit(100000)
def is_symmetric(s,i,j):
    if i>=j:
        return True
    if s[i]!=s[j]:
        return False
    return is_symmetric(s,i+1,j-1)
n = int(input())
s = input()
print("YES" if is_symmetric(s,0,n-1) else "NO")
Comment

PREVIOUS NEXT
Code Example
Python :: qmenu hide python 
Python :: download python for windows 7 32 bits 
Python :: wexpect in python 
Python :: python 3.10 windows 7 
Python :: python to pseudo code converter 
Python :: get value of a list of dictionary matching key 
Python :: vars() python 
Python :: how to reverse a number 
Python :: python plot confidence interval 
Python :: python shift array 
Python :: string -1 python 
Python :: python polymorphism 
Python :: remove nan from list 
Python :: python pandas if statement 
Python :: break continue pass in python 
Python :: do while in python 
Python :: show post id on django admin interface 
Python :: pyton for 
Python :: how to add element to list value in a dict python 
Python :: how to add virtual environment in vscode 
Python :: how to sort nested list in python 
Python :: import os python 
Python :: python ternary operators 
Python :: takes 2 positional arguments but 3 were given 
Python :: matplotlib subplots share x axis 
Python :: get list from list python 
Python :: Check if all values in list are greater than a certain number 
Python :: hide password in python 
Python :: tkinter filedialog filename 
Python :: django model queries 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =