give string s sort decrease order base frequency character the frequency character number time appear stringreturn sort string if multiple answer return Example 1input s treeoutput eertexplanation e appear twice r t appear onceSo e appear r t therefore eetr valid answerexample 2input s cccaaaoutput aaacccexplanation both c appear time cccaaa aaaccc valid answersnote cacaca incorrect character togetherexample 3input s AabbOutput bbaaexplanation bbaa valid answer Aabb incorrectNote a treat different character Constraints1 slength 5 105s consist uppercase lowercase english letter digit