Question d’entretien chez Amazon

Coding on Graph question which is medium level.