This comment is hidden because it contains spoiler information about the solution
Another cool linq answer.
I have found that if trying to stick with linq rather than using iteration sometimes my solutions end up like this one.
In this case, you are generating every single alignment of the two combs, using where to isolate those that have no overlap,
and then selecting the minimum size. This is a brute force method.
For 100 random tests, this code runs in anout 6ms while mine (using a while loop to skip without creating a new string) runs in a about 5ms.
I guess I learned something about early optimization.
Sum of nos in an AP...(COOL)
Does this work correctly for the case of DPDD?
Fixed in all three current languages.
Duplicate, not actionable.
How so? Can you give an example?
There is possibility to make it genberate wrong answare.
sure ... this isn't standard code, but you gotta give him some credit. These puzzles aren't necessarilly meant to be solved as quick as you can with completely readable code. The different solutions and different types of solutions make these problems fun. In my opinion this one line solution . . looks pretty sweet, and it's amazing it works. And who really cares if we don't understand the equation, that is how we explore and learn different/better/faster solutions
Already in description; can't find any typoes
This may overflow in (a+b) or (a-b) if a and b are large enough. Should convert them to long. Anyway, nice solution.