Welcome Back Friends!
We hope that you are able to understand the concepts of Graphs and problems based on Graph which have been discussed so far.
Moving further, in this article we will discuss about the next problem based on the Graph i.e. Perfect Friend.
Prerequisite for this problem is the Get Connected Components of Graph and Is Graph Connected. In case you have not gone through either of these problems, it is advised that you solve and understand these first.
So, talking of the Perfect Friend problem, this problem is again another interesting application of Get Connected.
Before you move any further, it is advised that you give this problem a fair try.
Let's jump to the problem.