Question

Write a function that takes one array of strings and returns all palindromic array of strings from it?

Login to Submit

Examples

The function takes one array of strings, and returns only those strings that are palindromes (read the same forwards and backwards).

input: ["madam", "hello", "racecar"]
output: ["madam", "racecar"]      // both are palindromes

input: ["apple", "banana", "noon"]
output: ["noon"]      // only "noon" is a palindrome