Skip to content

Instantly share code, notes, and snippets.

View juanplopes's full-sized avatar
🌲
Is that a Segment Tree problem?

Juan Lopes juanplopes

🌲
Is that a Segment Tree problem?
View GitHub Profile
//C#
public T FindInList<T>(IEnumerable<T> source, IEnumerable<T> target)
{
return source.First(target.Contains)
}
//F#
let FindInList (source : seq<_>) (target : seq<_>) = source.First(Func<_,bool>(target.Contains))
@juanplopes
juanplopes / gist:757685
Created December 28, 2010 20:41 — forked from tucaz/gist:757678
//C#
public T FindInList<T>(IEnumerable<T> source, IEnumerable<T> target)
{
return source.First(target.Contains)
//return source.Intersect(target).First();
}
//F#