COWA19F-Editorial

PROBLEM LINK:

Practice
Contest

Two strings are anagrams if the frequency of each character is same in both strings. In question, lexicographically maximum substring is asked. It will be the reverse of the given string after sorting.

TC - O(nlogn) (sorting, n=length of string)