> I'm not in this case, though.
> unordered_map is significant overhead, and storing every point in an integer range is unnecessary.
> My own solution -- a logical extension from what I posted above -- blows yours out of the water.
Brute force O(N*M) time, O(K) space...
'Brute force' means: this is clearly not the optimal solution or even one of the near-optimal solutions; this is a sub-optimal solution that is simple to implement.
> I do think your version of reality is a little extra rosy, though.
You are entitled to your own version of reality. My version of reality is based on my perceptions, not yours. And the way I post will continue to be based on my own perception of reality, not on that of others.
Thanks for the help, I'll go through the codes you guys made, I found another solutions, although not as efficient, essentially order all of the beginnings and endings of the intervals in one long 2*N string, and scan through them, each time you get a beginning, +1, ending -1, and then keep track of the maxcounter.