File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ # Runtime: 139 ms, faster than 60.43% of MySQL online submissions for Not Boring Movies.
2+ # Difficulty: Easy
3+
4+ SELECT * FROM cinema
5+ WHERE id % 2 = 1 AND description <> ' boring'
6+ ORDER BY - rating;
Original file line number Diff line number Diff line change 1+ # Runtime: 168 ms, faster than 59.75% of Python online submissions for Sum of Square Numbers.
2+ # Difficulty: Easy
3+
4+ from math import sqrt
5+
6+ class Solution (object ):
7+ def judgeSquareSum (self , c ):
8+ """
9+ :type c: int
10+ :rtype: bool
11+ """
12+ pointer_l , pointer_r = 0 , round (sqrt (c ))
13+ while pointer_l <= pointer_r :
14+ sum_squares = pointer_l * pointer_l + pointer_r * pointer_r
15+ if sum_squares == c :
16+ return True
17+ if sum_squares > c :
18+ pointer_r -= 1
19+ if sum_squares < c :
20+ pointer_l += 1
21+ return False
You can’t perform that action at this time.
0 commit comments