Minimum Money Needed Leetcode Javascript Practice Exercises