I am trying to optimize this function in my programm.
The Problem is, that this function only can be used for 10 rectangles, but i would like to have a solution, which is possible for a different number of rectangles. It would be also nice, if my array isn't that long anymore
If you have any suggestions, i would like to hear them.