Find First Palindromic String in the Array (Leetcode 2108)
Problem Link: https://leetcode.com/problems/find-first-palindromic-string-in-the-array/
class Solution:
def firstPalindrome(self, words: List[str]) -> str:
for i in words:
if(i==i[::-1]):
return i
return ""
PreviousReverse Words in a String III (Leetcode 557)NextMinimum Deletions to Make Character Frequencies Unique (Leetcode 1647)
Last updated