📄️ Guidelines
Whenever a certain element has a priority/advantage in a collection based on some property consider using a heap.
📄️ K Closest Points to Origin
Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0).
📄️ Find K Pairs with Smallest Sums
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k.
📄️ Top K Frequent Elements
Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.
📄️ Kth Largest Element in an Array
Given an integer array nums and an integer k, return the kth largest element in the array.
📄️ Sort Characters By Frequency
Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.
📄️ Reorganize String
Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.
📄️ Merge k Sorted Lists
You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.
📄️ Maximum Frequency Stack
Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.
📄️ Find Median from Data Stream
The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value, and the median is the mean of the two middle values.
📄️ Sliding Window Median
The median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle values.
📄️ Smallest Range Covering Elements from K Lists
Smallest Range Covering Elements from K Lists