for each number in A and each number in B if their difference is more than 3 ,add the new number
A={6,7,10}
B={2,3}
result={4,5,4,8,7}
for example :
6-2=4 true Add 4
6-3=3 false
7-2=5 true Add 5
my attempt :
var result = A.Select((a, i) => new
{
desired = a - B[i] > 3 ? a - B[i] :0
});
It sounds like you want:
Or in dot notation, which drops out really neatly:
With your test data: