Function to check if the characters in the given string forms a Palindrome in O ( 1 ) extra space
function isPalindrome ( str ) { let firstChar = 0 , lastChar = str . length - 1 ; let ch = true ; for ( let i = 0 ; i < str . length ; i ++ ) { firstChar = firstPos ( str , firstChar , lastChar ) ; lastChar = lastPos ( str , lastChar , firstChar ) ;