Unable to understand problem

Second rule is all except stranger know celebrity. So If stranger ask to anyone like A or B. They can directly tell about celebrity its O(1) not N Square.