cpp implementation of Container with Most Water