code: https://ide.codingblocks.com/s/469997
problem: no same permutations (cant find the link on hackerblocks but it is in the course problem section)
test cases are failing
code: https://ide.codingblocks.com/s/469997
problem: no same permutations (cant find the link on hackerblocks but it is in the course problem section)
test cases are failing
1 tc is:
input:
5
109 113 113 123 125
output:
109 113 113 123 125
109 113 113 125 123
109 113 123 113 125
109 113 123 125 113
109 113 125 113 123
109 113 125 123 113
109 123 113 113 125
109 123 113 125 113
109 123 125 113 113
109 125 113 113 123
109 125 113 123 113
109 125 123 113 113
113 109 113 123 125
113 109 113 125 123
113 109 123 113 125
113 109 123 125 113
113 109 125 113 123
113 109 125 123 113
113 113 109 123 125
113 113 109 125 123
113 113 123 109 125
113 113 123 125 109
113 113 125 109 123
113 113 125 123 109
113 123 109 113 125
113 123 109 125 113
113 123 113 109 125
113 123 113 125 109
113 123 125 109 113
113 123 125 113 109
113 125 109 113 123
113 125 109 123 113
113 125 113 109 123
113 125 113 123 109
113 125 123 109 113
113 125 123 113 109
123 109 113 113 125
123 109 113 125 113
123 109 125 113 113
123 113 109 113 125
123 113 109 125 113
123 113 113 109 125
123 113 113 125 109
123 113 125 109 113
123 113 125 113 109
123 125 109 113 113
123 125 113 109 113
123 125 113 113 109
125 109 113 113 123
125 109 113 123 113
125 109 123 113 113
125 113 109 113 123
125 113 109 123 113
125 113 113 109 123
125 113 113 123 109
125 113 123 109 113
125 113 123 113 109
125 123 109 113 113
125 123 113 109 113
125 123 113 113 109
hello @raghav007
try to use set to remove redundant entries.
or
please raise this doubt from the question itself .
as that will give me problem id and using that id i can search for the problem over hackerblocks.
is it possible to do it without set , I think it is when we don’t swap the identical elements, right?
…
try this .
a) sort ur input
b) dont bactrack.
c) keep that if(i!=j && a[i]==a[j]) as it is.
and see if it is working or not
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.