621. Task Scheduler | Leetcode | Medium | Java | Priority Queue | Striver's A to Z DSA Course/Sheet

  Рет қаралды 6,369

AlgorithmHQ

AlgorithmHQ

Күн бұрын

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...

Пікірлер: 7
@vishaldayalani7748
@vishaldayalani7748 8 ай бұрын
No need to use pair in Priority queue, just the frequency will work :) Appreciate the effort !
@parth7d2
@parth7d2 10 ай бұрын
Thanks ma'am :)🙏 (rnt= 38ms, bts = 13.48%)
@anushkarai5564
@anushkarai5564 8 ай бұрын
Thank you di. I saw many videos, but your explanation is the best :)
@algorithmsbyaditi
@algorithmsbyaditi 3 ай бұрын
Thanks a lot 😊
@QuadbTech
@QuadbTech 10 ай бұрын
Nicely explained 👍🏻
@AnujKumar-vu9gs
@AnujKumar-vu9gs 3 ай бұрын
jai shree krishna
@TON-108
@TON-108 7 ай бұрын
Thank You 🔥
Design Twitter - Leetcode 355 - Python
22:47
NeetCode
Рет қаралды 87 М.
Un coup venu de l’espace 😂😂😂
00:19
Nicocapone
Рет қаралды 10 МЛН
Mom had to stand up for the whole family!❤️😍😁
00:39
Task Scheduler - Leetcode 621 - Python
17:07
NeetCode
Рет қаралды 174 М.
Introduction to Heap Data Structure + Priority Queue + Heapsort Tutorial
1:11:07
Viral Video of a Man's Crazy Job Interview
16:02
Darryl Vega TV
Рет қаралды 1,3 МЛН
❌ Don't Run Behind 500 LEETCODE Problems ❌ Focus on QPCD
8:31
LeetCode 621. Task Scheduler (Algorithm Explained)
10:29
Nick White
Рет қаралды 63 М.
Priority Queue Introduction
13:18
WilliamFiset
Рет қаралды 463 М.