[LeetCode] Find Consecutive Integers from a Data Stream

1 · · Feb. 8, 2023, 7:36 a.m.
2526. Find Consecutive Integers from a Data Stream For a stream of integers, implement a data structure that checks if the last kvalue. 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, and false otherwise. If there are less than k integers, the condition does not hold true, so return...