Рет қаралды 6,369
We can arrive at the solution to this problem intuitively if we're familiar with the priority queue and regualar queue/stack concepts.
The algorithm revolves around picking the cards with minimum value on it and then moving to the next smallest card with preserving the current one using a queue/stack.
With the above algorithm we always try to look for some consecutive k cards and if the cards are not consecutive in a group we return false.
Link to the problem: leetcode.com/p...
Other problems for practice:
• 846. Hand of Straights...
• 992. Subarrays with K ...
• 1423. Maximum Points Y...
• Max Consecutive Ones I...
• Sum of Subarray Ranges...
• Sum of Subarray Minimu...
• Expression Add operato...
• Word Search | Leetcode...