LeetCode 1311. Get Watched Videos by Your Friends
链接: https://leetcode-cn.com/problems/get-watched-videos-by-your-friends/ 难度:medium 解题思路:广搜找到对应level的所有朋友,然后累加相应的video,最后排序。go语言没有啥priority queue,图简单这里排序用的直接插入排序,有点挫 Golang的数据结构支持太少了,各种都要自己写,真是麻烦。。 func watchedVideosByFriends(watchedVideos [][]string, friends [][]int, id int, level int) []string { visited := map[int]int{} queue := []Person {Person{i...阅读全文