words. Find the first word, in order, that reads the same left to right and right to left (a palindrome), and return it.
If there is no such word, return the empty string "".words=['tree', 'noon', 'kayak'] → 'noon'
"noon" reads the same both ways and comes before "kayak".
words=['ab', 'x'] → 'x'
A one-letter word is a palindrome too.
words=['map', 'top'] → ''
There are no palindromes, so the answer is the empty string.
words=['tree', 'noon', 'kayak']
'noon'
Run checks the first 3 tests in your browser. Submit checks all 104 tests on the server, hidden ones included.