[1050] 合作过至少三次的演员和导演
- GitHub
- http://leetcode.xuezhisd.top/post/176cd96a.html
- https://leetcode.com/problems/actors-and-directors-who-cooperated-at-least-three-times
- https://leetcode-cn.com/problems/actors-and-directors-who-cooperated-at-least-three-times
题目描述
ActorDirector
表:
+-------------+---------+ | Column Name | Type | +-------------+---------+ | actor_id | int | | director_id | int | | timestamp | int | +-------------+---------+ timestamp 是这张表的主键.
写一条SQL查询语句获取合作过至少三次的演员和导演的 id 对 (actor_id, director_id)
示例:
ActorDirector 表: +-------------+-------------+-------------+ | actor_id | director_id | timestamp | +-------------+-------------+-------------+ | 1 | 1 | 0 | | 1 | 1 | 1 | | 1 | 1 | 2 | | 1 | 2 | 3 | | 1 | 2 | 4 | | 2 | 1 | 5 | | 2 | 1 | 6 | +-------------+-------------+-------------+ Result 表: +-------------+-------------+ | actor_id | director_id | +-------------+-------------+ | 1 | 1 | +-------------+-------------+ 唯一的 id 对是 (1, 1),他们恰好合作了 3 次。
题目解析
- [请一句话描述题目…]
不确定性
方法一:[算法名称]
分析
思路
注意
知识点
复杂度
代码
1 | // |
方法二:[算法名称]
分析
思路
注意
知识点
复杂度
代码
1 | // |