You are viewing a single comment's thread. Return to all comments →
c# code
return arr.SelectMany((num, index) => arr.Skip(index + 1) .Where(nextNum => num + nextNum == m) .Select(nextNum => new List { index+1, arr.LastIndexOf(nextNum)+1 }) ).FirstOrDefault();
Seems like cookies are disabled on this browser, please enable them to open this website
Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
c# code
return arr.SelectMany((num, index) => arr.Skip(index + 1) .Where(nextNum => num + nextNum == m) .Select(nextNum => new List { index+1, arr.LastIndexOf(nextNum)+1 }) ).FirstOrDefault();