Veikedo

[C# interview] Split enumerable

Dec 7th, 2020 (edited)
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. // реализовать метод, который разбивает IEnumerable на несколько IEnumerable меньшего размера n
  2. // items = [1 2 3 4 5], n = 2
  3. // result = [ [1 2] [3 4] [5] ]
  4. //
  5. // items.Count() <= 1_000_000_000
  6. // n <= 100
  7.  
  8. using System.Collections.Generic;
  9.  
  10. public class Extensions
  11. {
  12.     public static IEnumerable<IEnumerable<T>> Split<T>(IEnumerable<T> items, int n)
  13.     {
  14.     }
  15. }
Add Comment
Please, Sign In to add comment