I need to create a multidimensional array in Java but with a random lenght of colums.
For example let's suppose the random lengths are 3, 2, 4 and 1, so we would have something like this:
[[1, 2, 3], [1, 2], [3, 4, 5, 6], [3]]
I have tried this, but it does not create a random length for each column:
int articles[][] = new int[50][(int) Math.floor(Math.random() * 30 + 1)];
Does anyone know how to achieve this?
Note: The array will always have 50 rows, I just need each column to be random.