File tree 2 files changed +13
-20
lines changed
g1301_1400/s1341_movie_rating
g2701_2800/s2791_count_paths_that_can_form_a_palindrome_in_a_tree
2 files changed +13
-20
lines changed Original file line number Diff line number Diff line change 1
1
# Write your MySQL query statement below
2
- # #Medium #Database #2023_06_13_Time_2387_ms_(59.80%)_Space_0B_(100.00%)
3
- with cte as
4
- (SELECT name, COUNT (RATING) as cnt,
5
- DENSE_RANK() over(order by COUNT (RATING) desc , name asc ) as rnk FROM MovieRating r
6
- INNER JOIN Users u ON r .user_id = u .user_id
7
- GROUP BY u .user_id
8
- limit 1 ),
9
-
10
- cte2 as
11
- (SELECT title, avg (rating) as avgr from MovieRating r
12
- INNER JOIN Movies m ON r .movie_id = m .movie_id
13
- where month(created_at) = 2
14
- group by r .movie_id
15
- order by avg (rating) desc , title asc
16
- limit 1 )
17
-
18
- select name as results from cte
19
- union all
20
- select title from cte2
2
+ # #Medium #Database #2023_08_15_Time_2843_ms_(48.31%)_Space_0B_(100.00%)
3
+ (SELECT name results
4
+ FROM Users as U, MovieRating as MR
5
+ WHERE U .user_id = MR .user_id
6
+ GROUP BY U .user_id
7
+ ORDER BY COUNT (MR .user_id ) DESC , name ASC LIMIT 1 )
8
+ UNION ALL
9
+ (SELECT title results
10
+ FROM Movies as M, MovieRating as MR
11
+ WHERE M .movie_id = MR .movie_id AND created_at BETWEEN ' 2020-02-01' AND ' 2020-02-29'
12
+ GROUP BY M .movie_id
13
+ ORDER BY AVG (rating) DESC , title ASC LIMIT 1 )
Original file line number Diff line number Diff line change 1
1
package g2701_2800.s2791_count_paths_that_can_form_a_palindrome_in_a_tree
2
2
3
- // #Hard #Dynamic_Programming #Tree #Bit_Manipulation #Bitmask #Depth_First_Search
3
+ // #Hard #Dynamic_Programming #Depth_First_Search # Tree #Bit_Manipulation #Bitmask
4
4
// #2023_08_06_Time_683_ms_(100.00%)_Space_54_MB_(100.00%)
5
5
6
6
class Solution {
You can’t perform that action at this time.
0 commit comments