Created
April 17, 2017 15:13
-
-
Save WeAthFoLD/f89856c3c5bf29799551e1c2bd9ca7b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
func isPalindrome(_ x: Int) -> Bool { | |
var y: String = x.description | |
if x < 0 { | |
return false | |
} | |
var count = y.characters.count | |
for i in 0..<count/2{ | |
guard y.characters.removeFirst() == y.characters.removeLast() else{ | |
return false | |
} | |
} | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thans a lot,but u forget the question number,what a pity(/ω\)
fat wolf: what a pity QAQ