Riot Games interview question

Had me build out a fairly simple algorithm.