// holat 2
// chunkwhile kengaytmasini amalga oshiring:
// - yonma-yon elementlarni guruhlarga birlashtiradi, agar samegroup(prev, current) == true bo'lsa.
var data = new[] { 1, 3, 5, 2, 4, 4, 7 };
var chunks = data.chunkwhile((prev, curr) => (prev % 2) == (curr % 2));
foreach (var chunk in chunks)
{
console.writeline($"[{string.join(", ", chunk)}]");
}
public static class case2class
{
public static ienumerable<ireadonlylist<t>> chunkwhile<t>(
this ienumerable<t> source,
func<t, t, bool> samegroup)
{
throw new notimplementedexception();
}
}