Pregunta de entrevista de Tibre

Typical three hackerrank questions, can be answered by python or c++