Codeforces Round 529(Div. 3) D. Circular Dance – Solution
Today we will talk about the solution of a codeforces problem. Here in this problem n kids are dancing. The kids are numbered from 1 to n. Each kid remembers that which 2 kids were in front of him/her but order of those 2 is not remembered. So, to solve this problem we will create a circular directed graph and run dfs algorithm. Let's see the solution