Leetcode 1423. Maximum Points You Can Obtain from Cards

Posted on Sun 26 June 2022 in Leetcode • Tagged with sliding-window, array

Question Link : https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards/

Difficulty: Medium

Question

There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array cardPoints. In one step, you can take one card from the beginning or from the …


Continue reading

Leetcode 2294. Partition Array Such That Maximum Difference Is K

Posted on Sat 18 June 2022 in Leetcode • Tagged with array

Question Link : https://leetcode.com/problems/partition-array-such-that-maximum-difference-is-k/

Difficulty: Medium

Question

You are given an integer array nums and an integer k. You may partition nums into one or more subsequences such that each element in nums appears in exactly one of the subsequences. Return the minimum number of subsequences needed …


Continue reading