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 2a4aba0

Browse files
Adding a snippet
1 parent 2f9a73c commit 2a4aba0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,4 +260,11 @@ def lengthOfLastWord(self, s: str) -> int:
260260
last=lst[-1]
261261
return len(last)
262262
return 0
263+
```
264+
### Valid Palindrome
265+
This method returns a bool value specifying whether a string is palindromic or not.
266+
```
267+
def isPalindrome(self, s: str) -> bool:
268+
s = [ x.lower() for x in s if x.isalnum() ]
269+
return s == s[::-1]
263270
```

0 commit comments

Comments
(0)

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