← All problemsSign in

2526. Find Consecutive Integers from a Data Stream

LeetCodeHash TableDesignQueueCountingData StreamOpen on judge ↗

For a stream of integers, implement a data structure that checks if the last k integers parsed in the stream are equal to value. Implement the DataStream class: - DataStream(int value, int k) Initializes the object with an empty integer stream and the two integers value and k. - boolean consec(int num) Adds num to the stream of integers. Returns true if the last k integers are equal to value, a

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