How do Facebook or Instagram check these so fast?
Time for competitive programmer to come up with the most optimal approach and prove your approach runs in the time. O(n) will surely not work, think of most optimal. Take in consideration there are special characters too. (Assume around 2 billion users)
Would love to know your ideas on this!!!