Hi everyone,
I am no longer going to edit this article. At least one Medium account copied the content almost verbatim, and I do not want to risk "muddying the waters" by making it look like this article came out after theirs.
That being said, there are a few things I really wanted to say for anyone reading this for the first time:
*The title of this is in quotes, and comes directly from a referenced Quora post. I have received lots of comments arguing that it is NOT hard, or that it is only hard for some people. These are completely valid points, but I did want it to be clear why it was called this. Some people seem to be commenting before they read that first sentence (not that it invalidates their points)
*That string compression problem is from the first chapter of Cracking the Coding Interview - you can find a harder Leetcode variation, as well. You should NOT solve this with a hashmap. One commenter said that you could, and I really appreciated his advice that you should talk through cases before you start coding or get set on an approach...but I do not personally agree with what he said about hashmaps. Though it may be possible, I do not see a benefit they provide. What you should do instead is a simple for loop, and (if it's the Leetcode variety) use two pointers. If you have never solved this problem before, I will try to not spoil any more of your fun
*What made so many people annoyed/confused with my hashmap section is that I went on to explain taking counts, which would help you solve a completely different problem called "anagrams"
*One comment about "backend engineers" is correct. Though you can be a software engineer who works very closely with hardware, backend means "server-side."