Company: Cohesity_28aug
Difficulty: medium
Reservoir Sampling Problem Description Given a stream of integers and a target size (K). Pick K elements from the stream such that the probability of any element getting picked is equal. The input `int_vec` represents the stream of integers. Assume the size is not known. Basically you are not allowed to use Int_vec.size() to sample. Input int_vec: An array of integers representing the stream. k: An integer, the target sample size. Output An array of integers containing k elements sampled from the stream. Constraints Execution time limit: 1 second (C++) Memory limit: 1 GB C++ Syntax Tips // Prints help message to the console // Returns a string string helloworld(string name) { cout The function signature for the solution is: vector<int> solution(vector<int> int_vec, int k) { // Your implementation here }