Celebrity Identification

Given the row-major flattened form of a square relation matrix, where matrix[a][b] is 1 when person a knows person b, find a celebrity. A celebrity is known by every other person and knows no other person. Return the celebrity's zero-based index, or -1 if no celebrity exists. The diagonal is ignored.

Examples
Input: [0,1,0,0,0,0,0,1,0]
Output: 1
Hints

Celebrity Identification

Given the row-major flattened form of a square relation matrix, where `matrix[a][b]` is `1` when person `a` knows person `b`, find a celebrity. A celebrity is known by every other person and knows no other person. Return the celebrity's zero-based index, or `-1` if no celebrity exists. The diagonal is ignored.