Find Circle Number
Problem Overview
- Manage friend circles among college students and answer two query types.
- Input: arrays queryType, student1, student2 (IDs 1..n); "Friend" links two IDs, "Total" asks about two IDs.
- Output: for each "Total", return the sum of the sizes of the two students' friend groups.
- Real-world context: evolving campus social networks; from Oracle interviews, a coding interview problem and common interview question.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
