Light Sources π©΅
Problem statement
In the expanse of a linear coordinate line, a celestial spectacle unfolds as numerous luminous orbs, each possessing its unique radiance, are strategically placed. The intricate details of these radiant spheres are cataloged within a two-dimensional array, dubbed "celestialArrangements." Each entry in this array encapsulates the essence of a single orb, revealing both its position and the extent of its luminosity.
Within the realm of "celestialArrangements":
- The ethereal coordinates of the ith orb are encapsulated in celestialArrangements[i][0].
- Manifesting its brilliance, the positive radius of the ith orb's radiance is manifested through celestialArrangements[i][1].
As the night unfolds, each orb casts its enchanting glow, spanning from celestialArrangements[i][0] - celestialArrangements[i][1] to celestialArrangements[i][0] + celestialArrangements[i][1], inclusively.
Yet, amidst this celestial ballet, a quest awaits. Adventurers must discern the mystical allure of those coordinates touched by the singular radiance of exactly one orb.
For original prompt, pls refer to source images Λββ§κ°απΈΰ»κ± β§βΛ
Function
lamps(lightSources: int[][]) β intExamples
Example 1
lightSources = [[-2, 3], [2, 3], [2, 1]]return = 6
For a set of luminous orbs with their respective radii, represented as [[-2, 3], [2, 3], [2, 1]], the resulting illumination yields 6 distinct sections. In the visual depiction, both overlapping and separate illuminated areas are observed, extending along the coordinate line from -6 to 6.
Constraints
Unknown for now