MediumHeap / Priority Queue
Reorganize String
Reorganize string by frequency
Solution Approach
Max heap
Complexity Analysis
Time Complexity
O(n*log n)Space Complexity
O(n)Complexity
Time:O(n*log n)
Space:O(n)
Asked at
GoogleAmazon
Reorganize string by frequency
Max heap
Time Complexity
O(n*log n)Space Complexity
O(n)