Question d’entretien chez J.P. Morgan

Two Python coding challenge. Followed by two questions explaining your methods behind your code and how would you improve it. Time limits: Coding: 40 and 50 min. Explanation: 20 min.