mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
75 lines
4.7 KiB
JSON
75 lines
4.7 KiB
JSON
{
|
|
"data": {
|
|
"question": {
|
|
"questionId": "579",
|
|
"questionFrontendId": "579",
|
|
"boundTopicId": null,
|
|
"title": "Find Cumulative Salary of an Employee",
|
|
"titleSlug": "find-cumulative-salary-of-an-employee",
|
|
"content": null,
|
|
"translatedTitle": null,
|
|
"translatedContent": null,
|
|
"isPaidOnly": true,
|
|
"difficulty": "Hard",
|
|
"likes": 228,
|
|
"dislikes": 400,
|
|
"isLiked": null,
|
|
"similarQuestions": "[]",
|
|
"exampleTestcases": "{\"headers\":{\"Employee\":[\"id\",\"month\",\"salary\"]},\"rows\":{\"Employee\":[[1,1,20],[2,1,20],[1,2,30],[2,2,30],[3,2,40],[1,3,40],[3,3,60],[1,4,60],[3,4,70],[1,7,90],[1,8,90]]}}",
|
|
"categoryTitle": "Database",
|
|
"contributors": [],
|
|
"topicTags": [
|
|
{
|
|
"name": "Database",
|
|
"slug": "database",
|
|
"translatedName": null,
|
|
"__typename": "TopicTagNode"
|
|
}
|
|
],
|
|
"companyTagStats": null,
|
|
"codeSnippets": null,
|
|
"stats": "{\"totalAccepted\": \"32.6K\", \"totalSubmission\": \"70.8K\", \"totalAcceptedRaw\": 32636, \"totalSubmissionRaw\": 70790, \"acRate\": \"46.1%\"}",
|
|
"hints": [
|
|
"Seem hard at first glance? Try to divide this problem into some sub-problems. \r\nThink about how to calculate the cumulative sum of one employee, how to get the cumulative sum for many employees, and how to except the most recent month of the result.",
|
|
"Use the technique of self-join if you have only one table but to write a complex query.",
|
|
"Still remember how to use the function `sum` and `max`?"
|
|
],
|
|
"solution": {
|
|
"id": "207",
|
|
"canSeeDetail": false,
|
|
"paidOnly": true,
|
|
"hasVideoSolution": false,
|
|
"paidOnlyVideo": true,
|
|
"__typename": "ArticleNode"
|
|
},
|
|
"status": null,
|
|
"sampleTestCase": "{\"headers\":{\"Employee\":[\"id\",\"month\",\"salary\"]},\"rows\":{\"Employee\":[[1,1,20],[2,1,20],[1,2,30],[2,2,30],[3,2,40],[1,3,40],[3,3,60],[1,4,60],[3,4,70],[1,7,90],[1,8,90]]}}",
|
|
"metaData": "{\"mysql\": [\"Create table If Not Exists Employee (id int, month int, salary int)\"], \"mssql\": [\"Create table Employee (id int, month int, salary int)\"], \"oraclesql\": [\"Create table Employee (id int, month int, salary int)\"], \"database\": true, \"name\": \"cumulative_salary\", \"pythondata\": [\"Employee = pd.DataFrame([], columns=['id', 'month', 'salary']).astype({'id':'Int64', 'month':'Int64', 'salary':'Int64'})\\n\"], \"postgresql\": [\"\\nCreate table If Not Exists Employee (id int, month int, salary int)\"], \"database_schema\": {\"Employee\": {\"id\": \"INT\", \"month\": \"INT\", \"salary\": \"INT\"}}}",
|
|
"judgerAvailable": true,
|
|
"judgeType": "large",
|
|
"mysqlSchemas": [
|
|
"Create table If Not Exists Employee (id int, month int, salary int)",
|
|
"Truncate table Employee",
|
|
"insert into Employee (id, month, salary) values ('1', '1', '20')",
|
|
"insert into Employee (id, month, salary) values ('2', '1', '20')",
|
|
"insert into Employee (id, month, salary) values ('1', '2', '30')",
|
|
"insert into Employee (id, month, salary) values ('2', '2', '30')",
|
|
"insert into Employee (id, month, salary) values ('3', '2', '40')",
|
|
"insert into Employee (id, month, salary) values ('1', '3', '40')",
|
|
"insert into Employee (id, month, salary) values ('3', '3', '60')",
|
|
"insert into Employee (id, month, salary) values ('1', '4', '60')",
|
|
"insert into Employee (id, month, salary) values ('3', '4', '70')",
|
|
"insert into Employee (id, month, salary) values ('1', '7', '90')",
|
|
"insert into Employee (id, month, salary) values ('1', '8', '90')"
|
|
],
|
|
"enableRunCode": true,
|
|
"enableTestMode": false,
|
|
"enableDebugger": false,
|
|
"envInfo": "{\"mysql\": [\"MySQL\", \"<p><code>MySQL 8.0</code>.</p>\"], \"mssql\": [\"MS SQL Server\", \"<p><code>mssql server 2019</code>.</p>\"], \"oraclesql\": [\"Oracle\", \"<p><code>Oracle Sql 11.2</code>.</p>\"], \"pythondata\": [\"Pandas\", \"<p>Python 3.10 with Pandas 2.0.2 and NumPy 1.25.0</p>\"], \"postgresql\": [\"PostgreSQL\", \"<p>PostgreSQL 16</p>\"]}",
|
|
"libraryUrl": null,
|
|
"adminUrl": null,
|
|
"challengeQuestion": null,
|
|
"__typename": "QuestionNode"
|
|
}
|
|
}
|
|
} |