No same Permutations

How to approach thi question without set or map
I solved the question using set and it shows TLE for 1 testcase

Heres the code - https://ide.codingblocks.com/s/297598

hello @ayu_15
pass ur vector by reference and then try

No Iā€™m still getting TLE for the last test case