Problem 1157 · Hard

Online Majority Element In Subarray

Answer each range query by counting values inside the range; a value that reaches the threshold is the majority.

Open the interactive visualisation