Water Container Problem Leetcode Python