Pregunta de entrevista de DXC Technology

They asked me to code for two problem statements