Skip to content

Commit 78c3a0a

Browse files
committed
updated 2108 python
1 parent 7263b3a commit 78c3a0a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
"""
22
2108. Find First Palindromic String in the Array
33
4-
Submitted: October 30, 2024
4+
Submitted: December 4, 2024
55
6-
Runtime: 21 ms (beats 5.80%)
7-
Memory: 16.76 MB (beats 52.46%)
6+
Runtime: 0 ms (beats 100.00%)
7+
Memory: 17.6 MB (beats 6.80%)
88
"""
99

1010
class Solution:
1111
def firstPalindrome(self, words: List[str]) -> str:
1212
for word in words:
13-
if all((i == j for i, j in zip(word, word[::-1]))): return word
14-
return ""
13+
if word == word[::-1]: return word
14+
return ""

0 commit comments

Comments
 (0)