fn part2(s: &str, key: &str) -> i32 {
    let h = parse_string_to_map(s);

    // We are basically trying to create a sort of a tree structure where the root is the "shiny gold"
    // then the what are the different ways to fill it. The different colors are the nodes and the
    // count becomes the edge-weight. Let's say we represent them as a tuple (i32, &str).
    // The idea is to traverse this tree. One can do by keeping tab of nodes at a level, The value for
    // the key of the map (which is vector) and then do a DFS until you get an empty list, at which
    // point you start coming up. When you are up a level, you multiple the edge weight to it to get
    // the total bags of that color in the level above.
    //
    // Now this can also be something like this:
    //                        A
    //                       / \
    //                      B   C
    //                     / \ / \
    //                    D   E   F
    //                   /   / \
    //                  G   H   I
    // So remember that we want to find the number of bags, then both B and C must add the edge weight
    // But when we take H and I, we shouldn't be double counting them (once for path B -> E -> H ..)
    //  and another time for (C -> E -> H ..)
    travel(key, &h, 0)
}
/// Part 2 is about the totl number of bags that will be required to fill up a shiny gold bag.
Part 2 is about the totl number of bags that will be required to fill up a shiny gold bag.
Part 2 is about the totl number of bags that will be required to fill up a shiny gold bag .
fn part2(s: &str, key: &str) -> i32 {
    let h = parse_string_to_map(s);
    // We are basically trying to create a sort of a tree structure where the root is the "shiny gold"
    // then the what are the different ways to fill it. The different colors are the nodes and the
    // count becomes the edge-weight. Let's say we represent them as a tuple (i32, &str).
    // The idea is to traverse this tree. One can do by keeping tab of nodes at a level, The value for
    // the key of the map (which is vector) and then do a DFS until you get an empty list, at which
    // point you start coming up. When you are up a level, you multiple the edge weight to it to get
    // the total bags of that color in the level above.
    //
    // Now this can also be something like this:
    //                        A
    //                       / \
    //                      B   C
    //                     / \ / \
    //                    D   E   F
    //                   /   / \
    //                  G   H   I
    // So remember that we want to find the number of bags, then both B and C must add the edge weight
    // But when we take H and I, we shouldn't be double counting them (once for path B -> E -> H ..)
    //  and another time for (C -> E -> H ..)
    travel(key, &h, 0)
}
fn part2 ( s : & str , key : & str ) -> i32 { let h = parse_string_to_map ( s ) ; // We are basically trying to create a sort of a tree structure where the root is the "shiny gold" // then the what are the different ways to fill it. The different colors are the nodes and the // count becomes the edge-weight. Let's say we represent them as a tuple (i32, &str). // The idea is to traverse this tree. One can do by keeping tab of nodes at a level, The value for // the key of the map (which is vector) and then do a DFS until you get an empty list, at which // point you start coming up. When you are up a level, you multiple the edge weight to it to get // the total bags of that color in the level above. // // Now this can also be something like this: //                        A //                       / \ //                      B   C //                     / \ / \ //                    D   E   F //                   /   / \ //                  G   H   I // So remember that we want to find the number of bags, then both B and C must add the edge weight // But when we take H and I, we shouldn't be double counting them (once for path B -> E -> H ..) //  and another time for (C -> E -> H ..) travel ( key , & h , 0 ) }
Part 2 is about the totl number of bags that will be required to fill up a shiny gold bag.
Part 2 is about the totl number of bags that will be required to fill up a shiny gold bag .
s
&str
key
&str
s
&str
key
&str