Problem Β· Intervals

Light Sources 🩡

● MediumTrade DeskINTERNOA

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 Λšβ‚Šβ€§κ’°αƒπŸΈΰ»’κ’± β€§β‚ŠΛš

    🐳🫧 Credit to ʚ robot ɞ ♫⋆qβ™ͺ β‚ŠΛšβ™¬ .

    Examples
    01 Β· Example 1
    lightSources = [[-2, 3], [2, 3], [2, 1]]
    return = 6
    Example 1 illustration
    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
    More Trade Desk problems
    drafts saved locally
    public int lamps(int[][] lightSources) {
      // write your code here
    }
    
    lightSources[[-2, 3], [2, 3], [2, 1]]
    expected6
    checking account