top of page

Q:Is itpossible to define an intersection of lists?

Q:Is itpossible to define an intersection of lists?

Example:

x[0..9] <- list(30);

y[i in 0..4] <- intersection(x[i], x[2*i+1]);

so that

for [i in 0..4][k in 0..29]

contains(y[i], k) == min(contains(x[i],k), contains(x[2*i+1], k));


A:You cannot build an "intersection"object, but you can implement a similar idea to 2.

y[i in 0..4][k in 0..29] <- min(contains(x[i],k), contains(x[2*i+1], k);


最新記事

すべて表示
bottom of page