mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 14:32:54 +08:00
update
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2534",
|
||||
"questionFrontendId": "2394",
|
||||
"boundTopicId": null,
|
||||
"title": "Employees With Deductions",
|
||||
"titleSlug": "employees-with-deductions",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 1,
|
||||
"dislikes": 2,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": null,
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"86\", \"totalSubmission\": \"108\", \"totalAcceptedRaw\": 86, \"totalSubmissionRaw\": 108, \"acRate\": \"79.6%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\": {\"Employees\": [\"employee_id\", \"needed_hours\"], \"Logs\": [\"employee_id\", \"in_time\", \"out_time\"]}, \"rows\": {\"Employees\": [[1, 20], [2, 12], [3, 2]], \"Logs\": [[1, \"2022-10-01 09:00:00\", \"2022-10-01 17:00:00\"],[1, \"2022-10-06 09:05:04\", \"2022-10-06 17:09:03\"], [1, \"2022-10-12 23:00:00\", \"2022-10-13 03:00:01\"], [2, \"2022-10-29 12:00:00\", \"2022-10-29 23:58:58\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Employees (employee_id int, needed_hours int)\",\n \"Create table If Not Exists Logs (employee_id int, in_time datetime, out_time datetime)\"\n ],\n \"mssql\": [\n \"Create table Employees (employee_id int, needed_hours int)\",\n \"Create table Logs (employee_id int, in_time datetime, out_time datetime)\"\n ],\n \"oraclesql\": [\n \"Create table Employees (employee_id int, needed_hours int)\",\n \"Create table Logs (employee_id int, in_time date, out_time date)\",\n \"ALTER SESSION SET nls_date_format='YYYY-MM-DD HH24:MI:SS'\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Employees (employee_id int, needed_hours int)",
|
||||
"Create table If Not Exists Logs (employee_id int, in_time datetime, out_time datetime)",
|
||||
"Truncate table Employees",
|
||||
"insert into Employees (employee_id, needed_hours) values ('1', '20')",
|
||||
"insert into Employees (employee_id, needed_hours) values ('2', '12')",
|
||||
"insert into Employees (employee_id, needed_hours) values ('3', '2')",
|
||||
"Truncate table Logs",
|
||||
"insert into Logs (employee_id, in_time, out_time) values ('1', '2022-10-01 09:00:00', '2022-10-01 17:00:00')",
|
||||
"insert into Logs (employee_id, in_time, out_time) values ('1', '2022-10-06 09:05:04', '2022-10-06 17:09:03')",
|
||||
"insert into Logs (employee_id, in_time, out_time) values ('1', '2022-10-12 23:00:00', '2022-10-13 03:00:01')",
|
||||
"insert into Logs (employee_id, in_time, out_time) values ('2', '2022-10-29 12:00:00', '2022-10-29 23:58:58')"
|
||||
],
|
||||
"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>\"]}",
|
||||
"libraryUrl": null,
|
||||
"adminUrl": null,
|
||||
"challengeQuestion": null,
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
@@ -0,0 +1,27 @@
|
||||
<p>Given two strings <code>needle</code> and <code>haystack</code>, return the index of the first occurrence of <code>needle</code> in <code>haystack</code>, or <code>-1</code> if <code>needle</code> is not part of <code>haystack</code>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> haystack = "sadbutsad", needle = "sad"
|
||||
<strong>Output:</strong> 0
|
||||
<strong>Explanation:</strong> "sad" occurs at index 0 and 6.
|
||||
The first occurrence is at index 0, so we return 0.
|
||||
</pre>
|
||||
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> haystack = "leetcode", needle = "leeto"
|
||||
<strong>Output:</strong> -1
|
||||
<strong>Explanation:</strong> "leeto" did not occur in "leetcode", so we return -1.
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= haystack.length, needle.length <= 10<sup>4</sup></code></li>
|
||||
<li><code>haystack</code> and <code>needle</code> consist of only lowercase English characters.</li>
|
||||
</ul>
|
Reference in New Issue
Block a user