Maximum Frequency Stack
Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.
Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.
Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.