loading...

re: Container with Most Water VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I came up with something slightly different: pub fn max_area(height: Vec<i32>) -> i32 { let mut best = 0; for left in 0..height...
 

This is correct, but have you considered the runtime complexity? What happens if a large input, say 10000 elements is provided?

Take a look at this playground for an example (it is likely to timeout so you may wish to copy the code and run it locally) :)

code of conduct - report abuse