No same permutations

question:https://hack.codingblocks.com/practice/p/406/908
https://ide.codingblocks.com/s/63285
not getting answer

please check your line 16 , if still unable to find mistake check the given solution

https://ide.codingblocks.com/s/65739

in the above solution set is being used, how can we do without using set