Algorithm · ByteDance · Hard
Problem: Find Players with Rankings Forced by Match Outcomes There are n competitors, and their actual ordering is a strict ranking from 1 through n, with no equal positions. The following condition applies: Whenever player x has a better rank than player y, x is guaranteed to defeat y. You receive m confirmed game results. A result written as a beat b states that a is certainly stronger than b (so a must appear ahead of b in the ranking). Determine every player whose…
Checking your access…