Got the j+1 part. Segmentation fault
. Also the abcd dcba is repeating. Once of prefix it prints abcd dcba, dcba abcd. Again for suffix it prints the same Please check for once.
Getting syntax errors
thats fine but then use push int not pair!
Yes there can be repetitions you can use set/unordered set to avoid duplicates.
I had initially used unordered_set but then I ran into issues as discussed above. Please help me. Iβve been stuck at this problem way too long 
unordered_set was recommended for storing answer!
What you can do is check before pushing in ans vector whether this entry exists already or not!
I feel its time to share my code for same:
My answer is still not getting accepted. Also please help me resolve the segmentation fault issue
On which test case is your code failing?
Itβs almost identical to mine and mine is accepted!
It was a silly mistake 
I had changed the name of the function and it was looking for the function. Hence it was showing the error. And for the segmentation fault, there was a mistake in the for loop.
Eventually it worked. Thanks a lot @mayankA47
Great! keep it up and mark doubt as resolved is satisfied
