ThirdEye AI interview question

R1: Write a code in Python to check whether a string is palindrome or not without reversing the string.

Interview Answer

Anonymous

18 Jul 2023

written in time complexity 0(n) string = input('Enter a string:') string_length = len(string) for index in range(string_length//2): if string[index] != string[string_length-index-1]: print('Not Palindrome') break else: print('Palindrome')