Say I have two arrays [1, 2, 3, 4, 5, 6] [true, false, true, false, false true];
I want to get a random number from the first list but only if the number corresponds to a true value in the array. Is there an fast, memory efficient way of doing this which - for my specific case - dosen't use Java.util.Arraylist?