c# - get indexes of different elements from arrays with equal length using Linq -
i have 2 arrays same length. example
arr1 {1,2,3,4,5,6,7,8,9,0}. arr2 {1,2,5,3,4,6,7,1,1,0}.
i need indexes of elements different:
{2,3,4,7,8}
how using linq?
the simplest think of:
int[] diff = enumerable.range(0, arr1.length).where(i => arr1[i] != arr2[i]).toarray();
Comments
Post a Comment