Find the Celebrity
Medium
Graph Basics
In a party of n people a celebrity is known by everyone but knows nobody. Given the matrix knows[i][j] (1 if i knows j), print the celebrity's index (0-indexed) or -1.
Constraints
2 <= n <= 100
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.