Created
December 30, 2021 12:06
-
-
Save DawChihLiou/530413e6d88ace4c8696a1dc467d4f26 to your computer and use it in GitHub Desktop.
This file contains 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
fn is_palindrome(str: String) -> bool { | |
let mut chars = string.bytes(); | |
while let Some((front, back)) = chars.next().zip(chars.next_back()) { | |
if front != back { | |
return false; | |
} | |
} | |
true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment