It would be difficult for two warships to collide without some of the material in one warship touching some of the material in the other one.
But there is no matter at an event horizon. That's just an imaginary line in space. It's opaque, but not solid.
If the black holes were moving fast enough, it should be possible for their event horizons to cross and then uncross, although that would immediately raise the question of what would happen to matter in the zone of overlap. Perhaps "fast enough" would exceed the speed of light?
I think you're playing fast-and-loose with the notion of "colliding".
First define what you mean by "colliding".
By analogy, I'm defining it as the Event Horizons intersecting, at which point nothing in side "either" black hole has any physical meaning to us ever again. For all we know, the insides could be chocolate ice cream on one half of the now-double-sized Event Horizon, and pure neutronium on the other. It's meaningless to even pretend we know anything about that volume.
Collision occurs when there is some sort of interaction between massy particles that try and fail to occupy the same space. Whatever stops you from passing through the floor counts as "collision".
An event horizon has no mass or other existence and cannot collide with anything. Within the black hole, there is mass somewhere, but generally not at the event horizon. If you're not comfortable assuming that, we can make it a definition - take this to be an example where none of the internal mass lies within the region of overlap.
What is the obstacle to the black holes separating again?
It's time itself that stops there. No matter what you want to move, you will have a problem moving it. It might be easier to understand that Democritean idea of space as literal nothingness is a bit old, in modern science space is field, i.e. solid matter (universe), particles move in it like sound for which steel is the most transparent medium, and nothingness is the most impenetrable, because there is no foothold there, we think it's empty because we can move freely in it.
Also most black holes have matter on the event horizon, because something fell on them. Maybe it can even touch, because this matter is frozen slightly above even horizon.
Time has also stopped for photons, which does nothing to stop them from moving from place to place.
I don't see a way to read your comment that allows for the possibility that a black hole might move, which is something they do.
I'm riiiiiiight on the edge of concluding that you are a poet and the only thing you know about the words is the way they sound. Is there more to it than that?
Technically time is exponentially dilated, this introduces large relativity of synchronism: the same thing takes different time in different reference frames. You aren't completely wrong to say black holes will fly through each other, but this doesn't take the same time in all reference frames. For a distant observer it takes infinite time after their event horizons touch, and Hawking radiation evaporates everything before that.
How black holes can move is an interesting question, but as you can see, in reality there are no infinities, since stuff slows down before that. Maybe infinities could exist for an observer inside black hole, but an observer outside of black hole sees only large slow down.
I solved it in less than 15 minutes while walking my dog, no pen or paper. But I wouldn't claim to be a random person without math skills. And my very first guess was correct.
It was a fun puzzle though and I'm surprised I didn't know it already. Thanks for sharing.
Why do you need to merge counts if you look for unique elements? Isn't the count always 1 for each element present? Isn't the key to shard your chunks so each element can appear in at most one chunk?