dsa1 min read
Sort Array by Increasing Frequency
Sort array elements by frequency ascending, breaking ties by value descending.
Read →
webcoderspeed.com
1276 articles
Sort array elements by frequency ascending, breaking ties by value descending.
Find the kth largest level sum in a binary tree using BFS to compute level sums then sorting or using a heap.
Minimize total hiring cost by always choosing the cheapest candidate from the first or last p candidates using two min-heaps.
Design a seat manager that reserves the lowest numbered available seat and unreserves seats using a min-heap.
Track stock prices with corrections by maintaining a sorted multiset and a timestamp-to-price map.