Tell me the test cases for which it is not running

Can you please tell me the test cases for which it is not running.

Print all the distinct permutations in a lexicographic order such that each permutation is in a new line. Note that there should not be any duplicate permutations.
try for this input
ABAA
correct output
AAAB
AABA
ABAA
BAAA
your output:
AAAB
AAAB
AABA
AABA
ABAA
ABAA
BAAA
BAAA

i have corrected it , now only for 1 test case it is coming TLE

Instead of adding elements to the arraylist and then sorting it before printing.

convert the string to a char array. Sort the char array. And then just print the permutations. In this you will save a lot of computation. And the permutations will be sorted

maam i dont understand the changes , can you please edit and send it to me .


this will save a lot of computation