Crossover for Work Interview Question

A code sample to determine output result.