Test cases problem

code is running fine for sample input but giving tle and wrong answer for some test cases.
code link : https://ide.codingblocks.com/s/88959

Hi @himanshukumarclassic37.hk,
listen in this question get all the permutations and before adding them to the arraylist just check that if the arraylist contains that permutation before then don’t add the permutation,if it does not have then add the permutation. and before printing just sort the arraylist.

Can u plzz tell me how can i check that if the arraylist contains the permutation or not

To check if an Arraylist contains a specified element you can use the contains() method.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.