write ContainerWithMostWater in both brute force and O(n) solution