Return Array with all Palindromes Found in String
You are given a lowercase string, which contains at least one 2 or 3 character palindrome as an argument. Return an array of strings containing all the palindromes found in the argument string.
Palindromes are strings that form the same word if it is reversed.
Requirements
- Must return an array of strings
Example #1
solve('ababa')
> ['aba', 'aba']
Example #2
solve('rdrairekeaca')
> ['rdr','eke','aca']