XYZ Interview Question

They gave me the most difficult coding question