MCPcopy Create free account
hub / github.com/clearloop/leetcode-cli / squash

Function squash

src/helper.rs:83–93  ·  view source on GitHub ↗

Squash questions and ids

(ps: &mut Vec<Problem>, ids: Vec<String>)

Source from the content-addressed store, hash-verified

81
82 /// Squash questions and ids
83 pub fn squash(ps: &mut Vec<Problem>, ids: Vec<String>) -> crate::Result<()> {
84 use std::collections::HashMap;
85
86 let mut map: HashMap<String, bool> = HashMap::new();
87 ids.iter().for_each(|x| {
88 map.insert(x.to_string(), true).unwrap_or_default();
89 });
90
91 ps.retain(|x| map.contains_key(&x.id.to_string()));
92 Ok(())
93 }
94}
95
96pub fn superscript(n: u8) -> String {

Callers 2

runMethod · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected