Can't find the solution of this problem

PLZ help me with its source code using hashmap only.


first approach

second approach
hashmap approach would be
put the first string in the map
now for i=1:n
store the reverse in a temp variable and check if this rev is present in the map
if yes return it as true that this is one pair and remove that word from the map
else push the original word in to the map
see if the word was found to be a pair like this then u do not need to push, why
if ab and ba are two words they are found as a pair then only way ba will be a palindrome again is only with ab and we have already check for ab so remove them both from the map
or alternately the better approach
first push all the strings in the map, we will get only unique strings
now for all the strings in the map check for the same condition as that of reverse