Available question text
Given an array of length n initially filled with 0 (uncolored), process point updates that set an index to a color and after each update return the number of adjacent index pairs that share the same nonzero color. With n and queries up to 1e5, the core challenge is to maintain this adjacent-equal count efficiently (each update only affects the two neighboring pairs).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2672. Number of Adjacent Elements With the Same Color
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source