Find First Palindromic String in the Array Problem

Find First Palindromic String in the Array Problem — ExecCode Easy DSA Practice

Solve the Find First Palindromic String in the Array problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given an array of strings words, return the first palindromic string in the array. Your task is to if there is no such string, return an empty string "". A string is palindromic if it reads the same forward and backward.

Examples

Input {"words": ["abc", "car", "ada", "racecar", "cool"]}; Output ada. Input {"words": ["notapalindrome", "racecar"]}; Output racecar

Constraints

1 <= words.length <= 100 1 <= words[i].length <= 100 words[i] consists only of lowercase English letters.

Practice Find First Palindromic String in the Array free on ExecCode. Browse DSA problems, topic map, and placement guides.