class Solution {
private fun isPalindrome(word: String): Boolean {
// casting to CharSequence -> new String
val reversedWord = word.reversed()
return word == reversedWord
}
fun firstPalindrome(words: Array<String>): String {
var answer = ""
for (word in words) {
if (isPalindrome(word)) {
answer = word
break
}
}
return answer
}
}