Loop to find if any palindromic string is still left in the array
for ( var i = 0 ; i < n ; i ++ ) { var s = a [ i ] ; a [ i ] = a [ i ] . split ( ' ' ) . reverse ( ) . join ( ' ' ) ; if ( a [ i ] != " " ) { if ( a [ i ] == s ) { s1 = a [ i ] ; break ; } } } var ans = " " ;