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

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -