I have used map instead of array for lastindex and visited
3 test cases not passing
please check
Sheldon Cooper unique string (C++)
Hey Nischay, one of your condition in line 28 is incorrect!
correct one is lastindex[s1.top()]>i
as you just have to see whether current popped element can come later or not.
thanks a lot for the help 