Minimum Money Needed Leetcode Sql