1 Followers
2 Following
15 Posts
@fasterthanlime nah I thought you were looking for help. Sorry!
@fasterthanlime you are almost there! A hint: you were already thinking in terms of “valve opened” instead of “minutes”, which is great. What the final result could look like is 2 sequences of valve opened. It doesn’t really matter how those sequences align in regards to each other, which is the trap of part 2: all that matters is for the human and the elephant to tell how much pressure they can release if they go visit a sequence of different valves, aka not one already visited and not one visited by the other one at step N.
@marcybell oh and if you want to put and between each element of a collection, you can simply my_collection.join(“ and “);
Hope that makes you feel even more badass with your new super powers!
@marcybell you can use 0..=n to avoid the +1.
Rust Playground

A browser interface to the Rust compiler to experiment with the language

@mistafunk as_usize
@MadMike77 and you sure do love hashtags! Welcome!
@fasterthanlime in one case your take the max of the run_max_by_key, in another the max of the run manual. It’s hard to know if those two operations are equivalent :s.