static L ocr_mergeOverlappingY(L l) { l = cloneList(l); bool change; do { change = false; for i over l: for (int j = i+1; j < l(l); j++) if (rectsOverlapY(l.get(i), l.get(j))) { l.set(i, mergeRects(l.get(i), l.get(j))); l.remove(j--); change = true; } } while (change); ret l; }