Push value to dict of vectors
Rust
#![allow(unused)] fn main() { let mut map: HashMap<u64, u64> = HashMap::new(); map.entry(50).or_default().push(0); }
Python
map = {}
map.setdefault(50, []).append(0);
#![allow(unused)] fn main() { let mut map: HashMap<u64, u64> = HashMap::new(); map.entry(50).or_default().push(0); }
map = {}
map.setdefault(50, []).append(0);