We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a00ff9 commit 52b09c0Copy full SHA for 52b09c0
contains-duplicate/easyone-jwlee.go
@@ -7,4 +7,4 @@ func containsDuplicate(nums []int) bool {
7
m[num] = num
8
}
9
return false
10
-}
+}
valid-palindrome/easyone-jwlee.go
@@ -0,0 +1,20 @@
1
+func isPalindrome(s string) bool {
2
+ s = strings.ToLower(s)
3
+ validStr := ""
4
+ for _, str := range s {
5
+ if ('a' > str || 'z' < str) && ('0' > str || '9' < str) {
6
+ continue
+ }
+ validStr += string(str)
+ if len(validStr) <= 1 {
11
+ return true
12
13
+ l := len(validStr)
14
+ for i := 0; i < l/2; i++ {
15
+ if validStr[i] != validStr[l-1-i] {
16
+ return false
17
18
19
20
0 commit comments