面试题 01.04. 回文排列
pub fn can_permute_palindrome(s: String) -> bool {let mut ch = vec![0; 128];for c in s.bytes() {ch[c as usize] += 1;}// fold表达式,直接操作每一个数作为n,然后得到了acc + (n & 1)作为新的accch.iter().fold(0, |acc, &n| acc + (n & 1)) < 2}
pub fn can_permute_palindrome(s: String) -> bool {let mut ch = vec![0; 128];for c in s.bytes() {ch[c as usize] += 1;}// fold表达式,直接操作每一个数作为n,然后得到了acc + (n & 1)作为新的accch.iter().fold(0, |acc, &n| acc + (n & 1)) < 2}
让时间为你证明