Using a priority queue to store the strings in accordance of the frequency and alphabetical order ( if frequency is equal ) Lambda expression is used set the priority , if frequencies are not equal than the string with greater frequency is returned else the string which is lexically smaller is returned
var Order = [ ] ;