Each row of the Problems table holds the like and dislike counts for one problem. A problem is low quality when its like ratio, likes / (likes + dislikes), is strictly less than 60%.
Return the problem_id of every low quality problem.
Input Table(s)
Problems (primary key problem_id)
| Column | Type | Meaning |
|---|
problem_id | INT | Primary key. One row per problem. |
likes | INT | Number of likes. NOT NULL. |
dislikes | INT | Number of dislikes. NOT NULL. |
Output Contract
-
One column:
problem_id
.
-
One row per low quality problem.
-
Sort by
problem_id
ascending.
Example
Problems
| problem_id | likes | dislikes |
|---|
| 1 | 60 | 40 |
| 2 | 59 | 41 |
| 3 | 100 | 0 |
| 4 | 0 | 100 |
Expected output
Problem 1 has exactly 60% likes, which is not strictly less than 60%, so it is not low quality. Problem 2 has 59% likes and problem 4 has 0%, so both are low quality. Problem 3 has 100% likes.
Constraints and Clarifications
-
The table has 1 to 10,000 rows, and
problem_id
is between 1 and 10,000.
-
likes
and
dislikes
are non-negative integers and never NULL.
-
likes + dislikes > 0
for every row, so the ratio is always defined.
-
The threshold is strict: a problem at exactly 60% is not low quality. Compare the exact ratio and do not round the percentage first.
-
problem_id
is unique, so each problem appears at most once in the result.