Minimum Money Needed Leetcode Sql Server