Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
handled
Yes
Do you suggest to change the formula to
S = S(R1) + S(R2) + S(R3) - S(R1 ∩ R2) - S(R1 ∩ R3) - S(R2 ∩ R3) + S(R1 ∩ R2 ∩ R3)
?I have an update regarding the description. The physical meaning of the problem is to calculate total area occupied by a set of rectanges. The formula in the description is not correct: it's true only when two rects intersect with each other. For three and more it gives wrong result (less that the real one because common area subtracted more time than it's needed).
for instance,
{{1, 4, 2, 7}, {1, 4, 2, 6}, {1, 4, 4, 5}, {2, 5, 6, 7}, {4, 3, 7, 6}}
Hey thank you for pointing that out. I did not noticed that. I laughed when I saw the error. It is a habit thing. When I compare Strings I always use the equalsIgnore.
Why are you using equalsIgnoreCase? '#' is not case-sensitive.
Would fit well for strange cases when you need low persormance for whatever reason. Average complexity here is O(n^3×log(n)) while some implementations achieve O(n).