Leetcode Implement Dynamic Pricing