How to set the array length according to the filled data? For example, we generate random numbers in the array i from 1 to 100 . create a for loop and which iterates over these numbers in the array i and if there are the same numbers if (x == y) then this data is transferred to the new array K
Problem: The new array K does not know the number of matched numbers in the array i - therefore, you cannot initially specify its size. How to create a function, where at the new found element from the array i new cell was generated in the array K ?