+ import std.math; import std.typecons; - import std.math; /* In this problem, you will implement a function that takes two arrays of numbers, - and determines whether it is possible to perform an exchange of elements ? ---- + and determines whether it is possible to perform an exchange of elements - between them to make lst1 an array of only even numbers. ? ---- + between them to make lst1 an array of only even numbers. - There is no limit on the number of exchanged elements between lst1 and lst2. ? ---- + There is no limit on the number of exchanged elements between lst1 and lst2. - If it is possible to exchange elements between the lst1 and lst2 to make ? ---- + If it is possible to exchange elements between the lst1 and lst2 to make - all the elements of lst1 to be even, return "YES". ? ---- + all the elements of lst1 to be even, return "YES". - Otherwise, return "NO". ? ---- + Otherwise, return "NO". - For example: ? ---- + For example: - >>> exchange([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L]) ? ---- + >>> exchange([1L, 2L, 3L, 4L], [1L, 2L, 3L, 4L]) - "YES" + "YES" - >>> exchange([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L]) ? ---- + >>> exchange([1L, 2L, 3L, 4L], [1L, 5L, 3L, 4L]) - "NO" + "NO" - It is assumed that the input arrays will be non-empty. ? ---- + It is assumed that the input arrays will be non-empty. - */ string exchange(long[] lst1, long[] lst2)