There are watchedVideos where watchedVideos[i] is the list of videos watched by person i, and a friends where friends[i] contains the IDs of the direct friends of person i.
Friendship is mutual, meaning if person i is friends with person j, then person j is friends with person i.
Given an integer id representing your person ID and an integer level, determine the list of videos watched by all people whose shortest distance to you in the friendship network is exactly equal to level.
Return the list of videos sorted by their total view frequency in ascending order. If multiple videos have the same frequency, sort them in lexicographical order.
Constraints:
n watchedVideos.length friends.length
watchedVideos[i].length
watchedVideos[i][j].length
friends[i].length
friends[i][j]
id
level
If friends[i] contains j, then friends[j] contains i.
There are watchedVideos where watchedVideos[i] is the list of videos watched by person i, and a friends where friends[i] contains the IDs of the direct friends of person i.
Friendship is mutual, meaning if person i is friends with person j, then person j is friends with person i.
Given an integer id representing your person ID and an integer level, determine the list of videos watched by all people whose shortest distance to you in the friendship network is exactly equal to level.
Return the list of videos sorted by their total view frequency in ascending order. If multiple videos have the same frequency, sort them in lexicographical order.
Constraints:
n watchedVideos.length friends.length
watchedVideos[i].length
watchedVideos[i][j].length
friends[i].length
friends[i][j]
id
level
If friends[i] contains j, then friends[j] contains i.