Back to problems

Display Sort

Algorithm · Figma · Hard

Problem: Display Sort A canvas contains several visible elements. Every element is described by a unique id and an axis-aligned bounding box given by (x, y, w, h), where (x, y) denotes the top-left corner, w the width, and h the height. Design a sorting function that returns the elements in visual reading order according to these rules: Rows are processed top-to-bottom. Two elements belong to the same row when their vertical ranges intersect. Within a row, elements appear…

Checking your access…