2019-11-10 LeetCode in Rust LeetCode 982. Triples with Bitwise AND Equal To Zero Problem Statement use std::collections::HashMap;impl Solution { pub fn count_triplets(a: Vec<i32>) -> i32 { let mut map = HashMap::new(); let mut ans = 0; for i in 0..a.len() { for j in 0..a.len() { let val = map.entry(a[i] & a[j]).or_insert(0); *val += 1; } } for i in a { for (key, val) in &map { if key & i == 0 { ans += *val; } } } return ans; }} Newer LeetCode 977. Squares of a Sorted Array Older LeetCode 987. Vertical Order Traversal of a Binary Tree