Minimum Money Needed Leetcode Problems Sqlite Python