Randoim values in a dynamic array C#

I have a relatively simple issue, I’m working on a game where you get shown a sequence of arrows and then you have to remember the order and press the keys accordingly, as the game gets more difficult more arrows are added to the sequence.

my plan to solve that is to have a sort of dynamic array store a random number between 1 and 4, and then add more to the array over time. How would you do something like this, if its not possible how would you create and store random values for a memory based game?

I don’t mean to promote my courses here, but I touch on this quite in depth in this course on [Model View Controller design pattern.][1] and this one touching on [OOP and SOLID design][2].

That said, you can do something like :

int [] RandomValues (int length, int range)
{
    int[] rv = new rv[length];
    for (int i = 0 ; i < length ; i++)
        rv *= Random.Range (0, range);*

return rv;
}
Random.Range(int, int) never returns the max value, so if range = 4, Random.Range(0, 4) will return any value between 0 and 3, thus 4 possibilities 0, 1, 2 and 3
[1]: https://www.udemy.com/unity-model-view-controller/?couponCode=UANSWERS_18
[2]: https://www.udemy.com/solid-object-oriented-programming-and-profiling-unity-5/?couponCode=UANSWERS_18