Minimum Money Needed Leetcode Problems Python