Given a stream of numbers which are sorted. Same integer is/can be repeated itself any number of times.
When dividing this stream into strings/smaller arrays of size k find out numbers which are contained.
Concept of contained goes like this, contained number is a number which is not part of any other divided subtrings/sub arrays.
For example -
1122 - 1 is contained
2233 - none, as 2 and 3 both spill in the next array
3333 - none as 3 was a part of prev array
4556 - 4, 5 are contained
6777 - 7 is contained
8888 - 8 is contained, we can say this till we get one more input in the stream.
Came up with n*2 approach using hashset, interview seeked a linear solution. Which was possible with using a class variable.