約 1000 レコードの配列があり、各レコードは次のプロパティを持つオブジェクトです。
- 結果 + 数値: 整数 (ID ではなく、繰り返すことができます) + 日付: DateTime
隣接する Date を持つ Result をカウントして最大限に活用したい。
誰でもアイデアを教えてもらえますか?
編集: 例:
I have an array:
List<Result> results = new List<Result> {
new Result(){ Number = 34, Date = "7/15/2011" },
new Result(){ Number = 59, Date = "7/15/2011" },
new Result(){ Number = 11, Date = "7/15/2011" },
new Result(){ Number = 1, Date = "7/16/2011" },
new Result(){ Number = 3, Date = "7/16/2011" },
new Result(){ Number = 34, Date = "7/16/2011" },
new Result(){ Number = 98, Date = "7/17/2011" },
new Result(){ Number = 34, Date = "7/17/2011" },
new Result(){ Number = 29, Date = "7/17/2011" },
new Result(){ Number = 99, Date = "7/17/2011" },
new Result(){ Number = 1, Date = "7/17/2011" },
new Result(){ Number = 31, Date = "7/18/2011" },
new Result(){ Number = 76, Date = "7/18/2011" },
new Result(){ Number = 47, Date = "7/18/2011" },
new Result(){ Number = 34, Date = "7/18/2011" },
new Result(){ Number = 99, Date = "7/19/2011" },
new Result(){ Number = 0, Date = "7/19/2011" },
new Result(){ Number = 88, Date = "7/19/2011" },
new Result(){ Number = 33, Date = "7/19/2011" }
};
As you see, all i want is to get:
- Number = 34 with 4 adjacent days
- Number = 1 with 2 adjacent days