Tricky permuatations (unique permuataions)

how can we do it without using a set…coz in lectures also sir used set

coz show TLE in 2/10 test cases…rest 8 are passed

Hey @hg11110000
Refer to this :