(RankList for this Question)
You are given an integer n which represents the number of chars, on the next n lines, you will be given a char and its count.
You need to construct a string with the chars and their count in the given order.
Output the next smallest colexicographic string.
Assume the strings are in a dictionary.
\(1 \leq n \leq 100\)
\(1 \leq count \leq 1000\)
Only lowercase characters
The first line contains the number of characters \(n\)
The next \(n\) lines contain the character and its count
Output a string which is the smallest colexicographic string
Since the strings are assumed to be in a dictionary, after 'z', 'aa' comes which is the next smallest colexicographic string.
Log In to solve the Question