wstring is almost done.
just remaining is to put the logic as per the solution. we can actually skip hashes)
see explaination for the last question.