Maximum Sum Path Leetcode Problems Sqlite Python