Given
IList<int> indexes;
ICollection<T> collection;
What is the most elegant way to extract all T in collection based on the the indexes provided in indexes?
For example, if collection contained
"Brian", "Cleveland", "Joe", "Glenn", "Mort"
And indexes contained
1, 3
The return would be
"Cleveland," "Glenn"
Edit: Assume that indexes is always sorted ascending.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…