Problem 1: Maximum Frequency Stack
https://leetcode.com/problems/maximum-frequency-stack/description/
Design a stack-like data structure to push elements to the stack and pop the most frequent element from the stack.
Implement the FreqStack class:
FreqStack() - Constructs an empty frequency stack
void push(int val) - Pushes an integer val onto the top of the stack
int pop() - Removes and returns the most frequent element in the stackIf there is a tie for the most frequent element, the element closest to the stack's top is removed and returned
Problem 2 : Minimum Cost of ropes
Given an array arr[] of rope lengths, connect all ropes into a single rope with the minimum total cost. The cost to connect two ropes is the sum of their lengths.