Skip to content

Instantly share code, notes, and snippets.

@DawChihLiou
Created December 30, 2021 12:06
Show Gist options
  • Save DawChihLiou/530413e6d88ace4c8696a1dc467d4f26 to your computer and use it in GitHub Desktop.
Save DawChihLiou/530413e6d88ace4c8696a1dc467d4f26 to your computer and use it in GitHub Desktop.
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