← All problemsSign in

Nearby Friends

## Problem Statement: Finding Nearby Friends Suppose there is a social networking site similar to Facebook where users are represented as nodes in a directed graph. Each node contains a random positive integer as data. You are given the task to help a user find out how many nodes in the graph are their friends. Two nodes are considered friends if the data of one node is a factor of the data of a

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start