Pergunta de entrevista da empresa DXC Technology

I was asked to code a complex question