Your question is Ordered Even/Odd With Goroutines. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Write a program to print even and odd numbers from a slice using goroutines while preserving the original order.
Implement the equivalent Python function print_even_odd(nums), where nums is a list of integers. Return a two-element list containing the even numbers and odd numbers, respectively, with each group retaining its original relative order. Use concurrent workers to classify values.
def print_even_odd(nums):