AJS and Strings practice questions
1) Check whether a string is Palindrome or not /** * Palindrome Check if the given string is a palindrome string. A sequence is said to be palindrome if reverse of the sequence is same as the initial sequence. Input Single line containing a string with no end of line character. String sequence contain only alphabets. Consider lower case letters as equivalent to upper case letters. Output Single containing YES if it is a palindrome Single containing NO if it isn't a palindrome Example Input: Tenet Output: YES */ let fs = require ( "fs" ); let data = fs . readFileSync ( 0 , "utf-8" ); let idx = 0 ; data = data. split ( " \n " ); function readLine () { idx ++ ; return data[idx - 1 ]. trim (); } // -------- Do NOT edit anything above this line ---------- // Use readLine() for taking input, it will read one line of from the input and is stored in string format let string = readLine (); let lenght = string. length ; let mark = true...