Visible Profiles Count

Problem Overview

  • Counts, for each queried user, how many profiles they can see from undirected connections.
  • Input: users, connections, arrays connection_from/connection_to, and queries; Output: int[] counts per query.
  • Set in a social media platform where visibility is through direct connections.
  • A coding interview problem and interview question asked in Ibm interviews.

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: