Pregunta de entrevista de Happiest Minds Technologies

asked to solve 2 problems in python