Pergunta de entrevista da empresa IBM

Two hackerank questions were asked