@Fangyyfrank Nice Thinking.
I noticed the note in the problem "The friend request could only been accepted once". Doesn't it mean when the case "A send B a friend request, and B send A a friend request" occurs, only one of A and B can accept it?
Like of course they can send friend request to each other, but once one of them accepts it (it will be recorded in the table) the other person won't be able to accept it again(It won't write this record to the table second time with same id pair). It is just like how Facebook works.
Please correct me if I am wrong, thanks.