Algorithm · Uber · Medium
Count Adjacent Same-Color Pairs Easy · Sorting · - · - You are given points on an infinitely long number line whose coordinates are non‑negative integers (0, 1, 2, …). Each point is assigned a color, specified by a pair (i, c) meaning the point at coordinate i receives color c. Several points may share the same color, and points that are not mentioned remain uncolored. After all assigned points have been colored, count how many adjacent pairs (i, i+1) exist such that both…
Checking your access…