fn travel(key: &str, hm: &HashMap<String, Vec<(i32, String)>>, spaces: i32) -> i32 {
    let mut bags_i_contain = 0;
    for v in hm.get(&key.to_string()) {
        let sp = spaces + 2;
        for (wt, k) in v {
            let contains = travel(k, hm, sp);
            bags_i_contain += wt + wt * contains;
            // print_me(
            //     format!("{}: As a result {} contains.", bags_i_contain, key),
            //     spaces,
            // );
        }
    }
    bags_i_contain
}
// returns:  The number of bags this level needs to contain inside it.
// So 0 for faded blue
//    0 for dotted black
//    11 for vibrant plum.
The number of bags this level needs to contain inside it.
So 0 for faded blue
0 for dotted black
11 for vibrant plum.
The number of bags this level needs to contain inside it . So 0 for faded blue 0 for dotted black 11 for vibrant plum .
fn travel(key: &str, hm: &HashMap<String, Vec<(i32, String)>>, spaces: i32) -> i32 {
    let mut bags_i_contain = 0;
    for v in hm.get(&key.to_string()) {
        let sp = spaces + 2;
        for (wt, k) in v {
            let contains = travel(k, hm, sp);
            bags_i_contain += wt + wt * contains;
            // print_me(
            //     format!("{}: As a result {} contains.", bags_i_contain, key),
            //     spaces,
            // );
        }
    }
    bags_i_contain
}
fn travel ( key : & str , hm : & HashMap < String , Vec < ( i32 , String ) > > , spaces : i32 ) -> i32 { let mut bags_i_contain = 0 ; for v in hm . get ( & key . to_string ( ) ) { let sp = spaces + 2 ; for ( wt , k ) in v { let contains = travel ( k , hm , sp ) ; bags_i_contain += wt + wt * contains ; // print_me( //     format!("{}: As a result {} contains.", bags_i_contain, key), //     spaces, // ); } } bags_i_contain }
returns:  The number of bags this level needs to contain inside it.
returns : The number of bags this level needs to contain inside it .
key
&str
hm
&HashMap<String, Vec<(i32, String)>>
spaces
i32
key
&str
hm
&HashMap<String, Vec<(i32, String)>>
spaces
i32