Question d’entretien chez BNY

Triple Hackerrank Algorithm question they have asked