You are given n people labeled 0 to n-1 at a party. You can call an API:
knows(a, b) -> bool
: returns
true
if person
a
knows person
b
, otherwise
false
.
A special person is defined as someone who:
i != x
,
knows(i, x) == true
), and
i != x
,
knows(x, i) == false
).
Return the label of the special person if one exists, otherwise return -1.
1 <= n <= 10^4
knows(a, a)
is undefined and should not be relied upon.