Skip to content

Instantly share code, notes, and snippets.

@yamnikov-oleg
Last active February 26, 2025 05:52
Show Gist options
  • Save yamnikov-oleg/b1a3d85051f92099638e8e94e48e821e to your computer and use it in GitHub Desktop.
Save yamnikov-oleg/b1a3d85051f92099638e8e94e48e821e to your computer and use it in GitHub Desktop.
Flutter: Separate
// ЗАДАНИЕ:
// Напишите функцию separate, которая вставляет новые элементы в Iterable
// некоторого произвольного типа.
// Новые элементы добавляются между каждой парой существующих элементов.
// separate должна возвращать Iterable того же типа.
//
// Например:
// separate([1, 2, 3], (a, b) => 0) // => [1, 0, 2, 0, 3]
// separate(["x", "y", "z"], (a, b) => a + b) // => ["x", "xy", "y", "yz", "z"]
//
// Максимально покройте функцию юнит-тестами.
import 'package:flutter_test/flutter_test.dart';
// ??? separate(???) {
// throw UnimplementedError();
// }
void main() {
test("...", () {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment