I wasted a lot of time on this because the custom input is broken.
Please note :
Custom input will not work as input string has a space at the end. To check your custom input, write this code before anything - A.erase(A.end()-1)
But at the time of submitting, erase the above code.
The return vector is expected to be sorted. (Not mentioned in the question)
The return vector should only have unique strings. (kind of self understood).