Max Flow Problem Leetcode Python