Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8862c3d

Browse files
added daily challenge
1 parent e6386e4 commit 8862c3d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def firstPalindrome(self, words: List[str]) -> str:
3+
for s in words:
4+
is_palindrome = True
5+
length = len(s)
6+
for i in range(length // 2):
7+
if s[i] != s[length - i - 1]:
8+
is_palindrome = False
9+
break
10+
if is_palindrome:
11+
return s
12+
return ""

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /