← All problemsSign in

Check Equal!

Soumy does not like distinctness. One day he got an array from his friend. He wanted to check if in a given range $l$ to $r$ all the elements are equal to $k$ or not. But since he is busy staring at the butterflies, he asked you to help him. In each query, you are given a range $l$ to $r$ and an integer $k$, print "YES" if all elements are equal to $k$ else "NO". ### Input - Size of array $n$ -

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start