mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 14:32:54 +08:00
update
This commit is contained in:
161
leetcode-cn/originData/Nsibyl.json
Normal file
161
leetcode-cn/originData/Nsibyl.json
Normal file
File diff suppressed because one or more lines are too long
161
leetcode-cn/originData/W2ZX4X.json
Normal file
161
leetcode-cn/originData/W2ZX4X.json
Normal file
File diff suppressed because one or more lines are too long
55
leetcode-cn/originData/[no content]bikes-last-time-used.json
Normal file
55
leetcode-cn/originData/[no content]bikes-last-time-used.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2841",
|
||||
"questionFrontendId": "2687",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2269584,
|
||||
"title": "Bikes Last Time Used ",
|
||||
"titleSlug": "bikes-last-time-used",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"21\", \"totalSubmission\": \"21\", \"totalAcceptedRaw\": 21, \"totalSubmissionRaw\": 21, \"acRate\": \"100.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Bikes\":[\"ride_id\",\"bike_number\",\"start_time\",\"end_time\"]},\"rows\":{\"Bikes\":[[1,\"W00576\",\"2012-03-25 11:30:00\",\"2012-03-25 12:40:00\"],[2,\"W00300\",\"2012-03-25 10:30:00\",\"2012-03-25 10:50:00\"],[3,\"W00455\",\"2012-03-26 14:30:00\",\"2012-03-26 17:40:00\"],[4,\"W00455\",\"2012-03-25 12:30:00\",\"2012-03-25 13:40:00\"],[5,\"W00576\",\"2012-03-25 08:10:00\",\"2012-03-25 09:10:00\"],[6,\"W00576\",\"2012-03-28 02:30:00\",\"2012-03-28 02:50:00\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Bikes (ride_id int,bike_number varchar(100), start_time datetime,end_time datetime)\"\n ],\n \"mssql\": [\n \"Create table Bikes (ride_id int,bike_number varchar(100), start_time datetime,end_time datetime)\"\n ],\n \"oraclesql\": [\n \"Create table Bikes (ride_id int,bike_number varchar(100), start_time date,end_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 Bikes (ride_id int,bike_number varchar(100), start_time datetime,end_time datetime)",
|
||||
"Truncate table Bikes",
|
||||
"insert into Bikes (ride_id, bike_number, start_time, end_time) values ('1', 'W00576', '2012-03-25 11:30:00', '2012-03-25 12:40:00')",
|
||||
"insert into Bikes (ride_id, bike_number, start_time, end_time) values ('2', 'W00300', '2012-03-25 10:30:00', '2012-03-25 10:50:00')",
|
||||
"insert into Bikes (ride_id, bike_number, start_time, end_time) values ('3', 'W00455', '2012-03-26 14:30:00', '2012-03-26 17:40:00')",
|
||||
"insert into Bikes (ride_id, bike_number, start_time, end_time) values ('4', 'W00455', '2012-03-25 12:30:00', '2012-03-25 13:40:00')",
|
||||
"insert into Bikes (ride_id, bike_number, start_time, end_time) values ('5', 'W00576', '2012-03-25 08:10:00', '2012-03-25 09:10:00')",
|
||||
"insert into Bikes (ride_id, bike_number, start_time, end_time) values ('6', 'W00576', '2012-03-28 02:30:00', '2012-03-28 02:50:00')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"Bikes\":[\"ride_id\",\"bike_number\",\"start_time\",\"end_time\"]},\"rows\":{\"Bikes\":[[1,\"W00576\",\"2012-03-25 11:30:00\",\"2012-03-25 12:40:00\"],[2,\"W00300\",\"2012-03-25 10:30:00\",\"2012-03-25 10:50:00\"],[3,\"W00455\",\"2012-03-26 14:30:00\",\"2012-03-26 17:40:00\"],[4,\"W00455\",\"2012-03-25 12:30:00\",\"2012-03-25 13:40:00\"],[5,\"W00576\",\"2012-03-25 08:10:00\",\"2012-03-25 09:10:00\"],[6,\"W00576\",\"2012-03-28 02:30:00\",\"2012-03-28 02:50:00\"]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2830",
|
||||
"questionFrontendId": "2669",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2259120,
|
||||
"title": "Count Artist Occurrences On Spotify Ranking List",
|
||||
"titleSlug": "count-artist-occurrences-on-spotify-ranking-list",
|
||||
"content": null,
|
||||
"translatedTitle": "统计 Spotify 排行榜上艺术家出现次数",
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": "数据库",
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"71\", \"totalSubmission\": \"90\", \"totalAcceptedRaw\": 71, \"totalSubmissionRaw\": 90, \"acRate\": \"78.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Spotify\":[\"id\",\"track_name\",\"artist\"]},\"rows\":{\"Spotify\":[[303651,\"Heart Won't Forget\",\"Ed Sheeran\"],[1046089,\"Shape of you\",\"Sia\"],[33445,\"I'm the one\",\"DJ Khalid\"],[811266,\"Young Dumb & Broke\",\"DJ Khalid\"],[505727,\"Happier\",\"Ed Sheeran\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Spotify (id int,track_name varchar(100),artist varchar(100))\"\n ],\n \"mssql\": [\n \"Create table Spotify (id int,track_name varchar(100),artist varchar(100))\"\n ],\n \"oraclesql\": [\n \"Create table Spotify (id int,track_name varchar(100),artist varchar(100))\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Spotify (id int,track_name varchar(100),artist varchar(100))",
|
||||
"Truncate table Spotify",
|
||||
"insert into Spotify (id, track_name, artist) values ('303651', 'Heart Won't Forget', 'Ed Sheeran')",
|
||||
"insert into Spotify (id, track_name, artist) values ('1046089', 'Shape of you', 'Sia')",
|
||||
"insert into Spotify (id, track_name, artist) values ('33445', 'I'm the one', 'DJ Khalid')",
|
||||
"insert into Spotify (id, track_name, artist) values ('811266', 'Young Dumb & Broke', 'DJ Khalid')",
|
||||
"insert into Spotify (id, track_name, artist) values ('505727', 'Happier', 'Ed Sheeran')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"Spotify\":[\"id\",\"track_name\",\"artist\"]},\"rows\":{\"Spotify\":[[303651,\"Heart Won't Forget\",\"Ed Sheeran\"],[1046089,\"Shape of you\",\"Sia\"],[33445,\"I'm the one\",\"DJ Khalid\"],[811266,\"Young Dumb & Broke\",\"DJ Khalid\"],[505727,\"Happier\",\"Ed Sheeran\"]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
55
leetcode-cn/originData/[no content]find-active-users.json
Normal file
55
leetcode-cn/originData/[no content]find-active-users.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2842",
|
||||
"questionFrontendId": "2688",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2269585,
|
||||
"title": "Find Active Users",
|
||||
"titleSlug": "find-active-users",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"14\", \"totalSubmission\": \"22\", \"totalAcceptedRaw\": 14, \"totalSubmissionRaw\": 22, \"acRate\": \"63.6%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Users\":[\"user_id\",\"item\",\"created_at\",\"amount\"]},\"rows\":{\"Users\":[[5,\"Smart Crock Pot\",\"2021-09-18\",698882],[6,\"Smart Lock\",\"2021-09-14\",11487],[6,\"Smart Thermostat\",\"2021-09-10\",674762],[8,\"Smart Light Strip\",\"2021-09-29\",630773],[4,\"Smart Cat Feeder\",\"2021-09-02\",693545],[4,\"Smart Bed\",\"2021-09-13\",170249]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Users (user_id int, item varchar(100),created_at date,amount int)\"\n ],\n \"mssql\": [\n \"Create table Users (user_id int, item varchar(100),created_at date,amount int)\"\n ],\n \"oraclesql\": [\n \"Create table Users (user_id int, item varchar(100),created_at date,amount int)\",\n \"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Users (user_id int, item varchar(100),created_at date,amount int)",
|
||||
"Truncate table Users",
|
||||
"insert into Users (user_id, item, created_at, amount) values ('5', 'Smart Crock Pot', '2021-09-18', '698882')",
|
||||
"insert into Users (user_id, item, created_at, amount) values ('6', 'Smart Lock', '2021-09-14', '11487')",
|
||||
"insert into Users (user_id, item, created_at, amount) values ('6', 'Smart Thermostat', '2021-09-10', '674762')",
|
||||
"insert into Users (user_id, item, created_at, amount) values ('8', 'Smart Light Strip', '2021-09-29', '630773')",
|
||||
"insert into Users (user_id, item, created_at, amount) values ('4', 'Smart Cat Feeder', '2021-09-02', '693545')",
|
||||
"insert into Users (user_id, item, created_at, amount) values ('4', 'Smart Bed', '2021-09-13', '170249')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"Users\":[\"user_id\",\"item\",\"created_at\",\"amount\"]},\"rows\":{\"Users\":[[5,\"Smart Crock Pot\",\"2021-09-18\",698882],[6,\"Smart Lock\",\"2021-09-14\",11487],[6,\"Smart Thermostat\",\"2021-09-10\",674762],[8,\"Smart Light Strip\",\"2021-09-29\",630773],[4,\"Smart Cat Feeder\",\"2021-09-02\",693545],[4,\"Smart Bed\",\"2021-09-13\",170249]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
66
leetcode-cn/originData/[no content]find-latest-salaries.json
Normal file
66
leetcode-cn/originData/[no content]find-latest-salaries.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2829",
|
||||
"questionFrontendId": "2668",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2257550,
|
||||
"title": "Find Latest Salaries",
|
||||
"titleSlug": "find-latest-salaries",
|
||||
"content": null,
|
||||
"translatedTitle": "查询员工当前薪水",
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": "数据库",
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"79\", \"totalSubmission\": \"109\", \"totalAcceptedRaw\": 79, \"totalSubmissionRaw\": 109, \"acRate\": \"72.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Salary\":[\"emp_id\",\"firstname\",\"lastname\",\"salary\",\"department_id\"]},\"rows\":{\"Salary\":[[1,\"Todd\",\"Wilson\",110000,\"D1006\"],[1,\"Todd\",\"Wilson\",106119,\"D1006\"],[2,\"Justin\",\"Simon\",128922,\"D1005\"],[2,\"Justin\",\"Simon\",130000,\"D1005\"],[3,\"Kelly\",\"Rosario\",42689,\"D1002\"],[4,\"Patricia\",\"Powell\",162825,\"D1004\"],[4,\"Patricia\",\"Powell\",170000,\"D1004\"],[5,\"Sherry\",\"Golden\",44101,\"D1002\"],[6,\"Natasha\",\"Swanson\",79632,\"D1005\"],[6,\"Natasha\",\"Swanson\",90000,\"D1005\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))\"\n ],\n \"mssql\": [\n \"Create table Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))\"\n ],\n \"oraclesql\": [\n \"Create table Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Salary (emp_id int,firstname varchar(100),lastname varchar(100),salary int, department_id varchar(100))",
|
||||
"Truncate table Salary",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('1', 'Todd', 'Wilson', '110000', 'D1006')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('1', 'Todd', 'Wilson', '106119', 'D1006')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('2', 'Justin', 'Simon', '128922', 'D1005')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('2', 'Justin', 'Simon', '130000', 'D1005')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('3', 'Kelly', 'Rosario', '42689', 'D1002')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('4', 'Patricia', 'Powell', '162825', 'D1004')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('4', 'Patricia', 'Powell', '170000', 'D1004')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('5', 'Sherry', 'Golden', '44101', 'D1002')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('6', 'Natasha', 'Swanson', '79632', 'D1005')",
|
||||
"insert into Salary (emp_id, firstname, lastname, salary, department_id) values ('6', 'Natasha', 'Swanson', '90000', 'D1005')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"Salary\":[\"emp_id\",\"firstname\",\"lastname\",\"salary\",\"department_id\"]},\"rows\":{\"Salary\":[[1,\"Todd\",\"Wilson\",110000,\"D1006\"],[1,\"Todd\",\"Wilson\",106119,\"D1006\"],[2,\"Justin\",\"Simon\",128922,\"D1005\"],[2,\"Justin\",\"Simon\",130000,\"D1005\"],[3,\"Kelly\",\"Rosario\",42689,\"D1002\"],[4,\"Patricia\",\"Powell\",162825,\"D1004\"],[4,\"Patricia\",\"Powell\",170000,\"D1004\"],[5,\"Sherry\",\"Golden\",44101,\"D1002\"],[6,\"Natasha\",\"Swanson\",79632,\"D1005\"],[6,\"Natasha\",\"Swanson\",90000,\"D1005\"]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2840",
|
||||
"questionFrontendId": "2686",
|
||||
"categoryTitle": "Database",
|
||||
"boundTopicId": 2269586,
|
||||
"title": "Immediate Food Delivery III",
|
||||
"titleSlug": "immediate-food-delivery-iii",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": null,
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"18\", \"totalSubmission\": \"21\", \"totalAcceptedRaw\": 18, \"totalSubmissionRaw\": 21, \"acRate\": \"85.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Delivery\":[\"delivery_id\",\"customer_id\",\"order_date\",\"customer_pref_delivery_date\"]},\"rows\":{\"Delivery\":[[1,1,\"2019-08-01\",\"2019-08-02\"],[2,2,\"2019-08-01\",\"2019-08-01\"],[3,1,\"2019-08-01\",\"2019-08-01\"],[4,3,\"2019-08-02\",\"2019-08-13\"],[5,3,\"2019-08-02\",\"2019-08-02\"],[6,2,\"2019-08-02\",\"2019-08-02\"],[7,4,\"2019-08-03\",\"2019-08-03\"],[8,1,\"2019-08-03\",\"2019-08-03\"],[9,5,\"2019-08-04\",\"2019-08-18\"],[10,2,\"2019-08-04\",\"2019-08-18\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Delivery (delivery_id int, customer_id int, order_date date, customer_pref_delivery_date date)\"\n ],\n \"mssql\": [\n \"Create table Delivery (delivery_id int, customer_id int, order_date date, customer_pref_delivery_date date)\"\n ],\n \"oraclesql\": [\n \"Create table Delivery (delivery_id int, customer_id int, order_date date, customer_pref_delivery_date date)\",\n \"ALTER SESSION SET nls_date_format='YYYY-MM-DD'\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Delivery (delivery_id int, customer_id int, order_date date, customer_pref_delivery_date date)",
|
||||
"Truncate table Delivery",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('1', '1', '2019-08-01', '2019-08-02')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('2', '2', '2019-08-01', '2019-08-01')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('3', '1', '2019-08-01', '2019-08-01')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('4', '3', '2019-08-02', '2019-08-13')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('5', '3', '2019-08-02', '2019-08-02')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('6', '2', '2019-08-02', '2019-08-02')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('7', '4', '2019-08-03', '2019-08-03')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('8', '1', '2019-08-03', '2019-08-03')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('9', '5', '2019-08-04', '2019-08-18')",
|
||||
"insert into Delivery (delivery_id, customer_id, order_date, customer_pref_delivery_date) values ('10', '2', '2019-08-04', '2019-08-18')"
|
||||
],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"mysql\":[\"MySQL\",\"<p>\\u7248\\u672c\\uff1a<code>MySQL 8.0<\\/code><\\/p>\"],\"mssql\":[\"MS SQL Server\",\"<p>mssql server 2019.<\\/p>\"],\"oraclesql\":[\"Oracle\",\"<p>Oracle Sql 11.2.<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "{\"headers\":{\"Delivery\":[\"delivery_id\",\"customer_id\",\"order_date\",\"customer_pref_delivery_date\"]},\"rows\":{\"Delivery\":[[1,1,\"2019-08-01\",\"2019-08-02\"],[2,2,\"2019-08-01\",\"2019-08-01\"],[3,1,\"2019-08-01\",\"2019-08-01\"],[4,3,\"2019-08-02\",\"2019-08-13\"],[5,3,\"2019-08-02\",\"2019-08-02\"],[6,2,\"2019-08-02\",\"2019-08-02\"],[7,4,\"2019-08-03\",\"2019-08-03\"],[8,1,\"2019-08-03\",\"2019-08-03\"],[9,5,\"2019-08-04\",\"2019-08-18\"],[10,2,\"2019-08-04\",\"2019-08-18\"]]}}",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
65
leetcode-cn/originData/[no content]the-knights-tour.json
Normal file
65
leetcode-cn/originData/[no content]the-knights-tour.json
Normal file
File diff suppressed because one or more lines are too long
59
leetcode-cn/originData/allow-one-function-call.json
Normal file
59
leetcode-cn/originData/allow-one-function-call.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2796",
|
||||
"questionFrontendId": "2666",
|
||||
"categoryTitle": "JavaScript",
|
||||
"boundTopicId": 2262650,
|
||||
"title": "Allow One Function Call",
|
||||
"titleSlug": "allow-one-function-call",
|
||||
"content": "<p>Given a function <code>fn</code>, return a new function that is identical to the original function except that it ensures <code>fn</code> is called at most once.</p>\n\n<ul>\n\t<li>The first time the returned function is called, it should return the same result as <code>fn</code>.</li>\n\t<li>Every subsequent time it is called, it should return <code>undefined</code>.</li>\n</ul>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> fn = (a,b,c) => (a + b + c), calls = [[1,2,3],[2,3,6]]\n<strong>Output:</strong> [{"calls":1,"value":6}]\n<strong>Explanation:</strong>\nconst onceFn = once(fn);\nonceFn(1, 2, 3); // 6\nonceFn(2, 3, 6); // undefined, fn was not called\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> fn = (a,b,c) => (a * b * c), calls = [[5,7,4],[2,3,6],[4,6,8]]\n<strong>Output:</strong> [{"calls":1,"value":140}]\n<strong>Explanation:</strong>\nconst onceFn = once(fn);\nonceFn(5, 7, 4); // 140\nonceFn(2, 3, 6); // undefined, fn was not called\nonceFn(4, 6, 8); // undefined, fn was not called\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= calls.length <= 10</code></li>\n\t<li><code>1 <= calls[i].length <= 100</code></li>\n\t<li><code>2 <= JSON.stringify(calls).length <= 1000</code></li>\n</ul>\n",
|
||||
"translatedTitle": "只允许一次函数调用",
|
||||
"translatedContent": "<p>给定一个函数 <code>fn</code> ,它返回一个新的函数,返回的函数与原始函数完全相同,只不过它确保 <code>fn</code> 最多被调用一次。</p>\n\n<ul>\n\t<li>第一次调用返回的函数时,它应该返回与 <code>fn</code> 相同的结果。</li>\n\t<li>第一次后的每次调用,它应该返回 <code>undefined</code> 。</li>\n</ul>\n\n<p> </p>\n\n<p><b>示例 1:</b></p>\n\n<pre>\n<b>输入:</b>fn = (a,b,c) => (a + b + c), calls = [[1,2,3],[2,3,6]]\n<b>输出:</b>[{\"calls\":1,\"value\":6}]\n<strong>解释:</strong>\nconst onceFn = once(fn);\nonceFn(1, 2, 3); // 6\nonceFn(2, 3, 6); // undefined, fn 没有被调用\n</pre>\n\n<p><strong class=\"example\">示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>fn = (a,b,c) => (a * b * c), calls = [[5,7,4],[2,3,6],[4,6,8]]\n<b>输出:</b>[{\"calls\":1,\"value\":140}]\n<strong>解释:</strong>\nconst onceFn = once(fn);\nonceFn(5, 7, 4); // 140\nonceFn(2, 3, 6); // undefined, fn 没有被调用\nonceFn(4, 6, 8); // undefined, fn 没有被调用\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= calls.length <= 10</code></li>\n\t<li><code>1 <= calls[i].length <= 100</code></li>\n\t<li><code>2 <= JSON.stringify(calls).length <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": true, \"java\": true, \"python\": true, \"python3\": true, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"dart\": false}",
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @param {Function} fn\n * @return {Function}\n */\nvar once = function(fn) {\n return function(...args){\n \n }\n};\n\n/**\n * let fn = (a,b,c) => (a + b + c)\n * let onceFn = once(fn)\n *\n * onceFn(1,2,3); // 6\n * onceFn(2,3,6); // returns undefined without calling fn\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "function once<T extends (...args: any[]) => any>(fn: T): \n ((...args: Parameters<T>) => ReturnType<T> | undefined) {\n return function (...args) {\n\n };\n}\n\n/**\n * let fn = (a,b,c) => (a + b + c)\n * let onceFn = once(fn)\n *\n * onceFn(1,2,3); // 6\n * onceFn(2,3,6); // returns undefined without calling fn\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"326\", \"totalSubmission\": \"394\", \"totalAcceptedRaw\": 326, \"totalSubmissionRaw\": 394, \"acRate\": \"82.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "(a,b,c) => (a + b + c)\n[[1,2,3],[2,3,6]]",
|
||||
"metaData": "{\n \"name\": \"once\",\n \"params\": [\n {\n \"name\": \"fn\",\n \"type\": \"string\"\n },\n {\n \"type\": \"string\",\n \"name\": \"calls\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"javascript\":[\"JavaScript\",\"<p>\\u7248\\u672c\\uff1a<code>Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a <code>--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f <a href=\\\"http:\\/\\/node.green\\/\\\" target=\\\"_blank\\\">\\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 4.5.4<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "(a,b,c) => (a + b + c)\n[[1,2,3],[2,3,6]]\n(a,b,c) => (a * b * c)\n[[5,7,4],[2,3,6],[4,6,8]]",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
63
leetcode-cn/originData/array-of-objects-to-matrix.json
Normal file
63
leetcode-cn/originData/array-of-objects-to-matrix.json
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2769",
|
||||
"questionFrontendId": "2675",
|
||||
"categoryTitle": "JavaScript",
|
||||
"boundTopicId": 2267107,
|
||||
"title": "Array of Objects to Matrix",
|
||||
"titleSlug": "array-of-objects-to-matrix",
|
||||
"content": "<p>Write a function that converts an array of objects <code>arr</code> into a matrix <code>m</code>.</p>\n\n<p><code>arr</code> is an array of objects or arrays. Each item in the array can be deeply nested with child arrays and child objects. It can also contain numbers, strings, booleans, and null values.</p>\n\n<p>The first row <code>m</code> should be the column names. If there is no nesting, the column names are the unique keys within the objects. If there is nesting, the column names are the respective paths in the object separated by <code>"."</code>.</p>\n\n<p>Each of the remaining rows corresponds to an object in <code>arr</code>. Each value in the matrix corresponds to a value in an object. If a given object doesn't contain a value for a given column, the cell should contain an empty string <code>""</code>.</p>\n\n<p>The colums in the matrix should be in <strong>lexographically ascending</strong> order.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> \narr = [\n {"b": 1, "a": 2},\n {"b": 3, "a": 4}\n]\n<strong>Output:</strong> \n[\n ["a", "b"],\n [2, 1],\n [4, 3]\n]\n\n<strong>Explanation:</strong>\nThere are two unique column names in the two objects: "a" and "b".\n"a" corresponds with [2, 4].\n"b" coresponds with [1, 3].\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> \narr = [\n {"a": 1, "b": 2},\n {"c": 3, "d": 4},\n {}\n]\n<strong>Output:</strong> \n[\n ["a", "b", "c", "d"],\n [1, 2, "", ""],\n ["", "", 3, 4],\n ["", "", "", ""]\n]\n\n<strong>Explanation:</strong>\nThere are 4 unique column names: "a", "b", "c", "d".\nThe first object has values associated with "a" and "b".\nThe second object has values associated with "c" and "d".\nThe third object has no keys, so it is just a row of empty strings.\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> \narr = [\n {"a": {"b": 1, "c": 2}},\n {"a": {"b": 3, "d": 4}}\n]\n<strong>Output:</strong> \n[\n ["a.b", "a.c", "a.d"],\n [1, 2, ""],\n [3, "", 4]\n]\n\n<strong>Explanation:</strong>\nIn this example, the objects are nested. The keys represent the full path to each value separated by periods.\nThere are three paths: "a.b", "a.c", "a.d".\n</pre>\n\n<p><strong class=\"example\">Example 4:</strong></p>\n\n<pre>\n<strong>Input:</strong> \narr = [\n [{"a": null}],\n [{"b": true}],\n [{"c": "x"}]\n]\n<strong>Output:</strong> \n[\n ["0.a", "0.b", "0.c"],\n [null, "", ""],\n ["", true, ""],\n ["", "", "x"]\n]\n\n<strong>Explanation:</strong>\nArrays are also considered objects with their keys being their indices.\nEach array has one element so the keys are "0.a", "0.b", and "0.c".\n</pre>\n\n<p><strong class=\"example\">Example 5:</strong></p>\n\n<pre>\n<strong>Input:</strong> \narr = [\n {},\n {},\n {},\n]\n<strong>Output:</strong> \n[\n [],\n [],\n [],\n []\n]\n\n<strong>Explanation:</strong>\nThere are no keys so every row is an empty array.</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr.length <= 1000</code></li>\n\t<li><code>unique keys <= 1000</code></li>\n</ul>\n",
|
||||
"translatedTitle": "将对象数组转换为矩阵",
|
||||
"translatedContent": "<p>编写一个函数,将对象数组 <code>arr</code> 转换为矩阵 <code>m</code> 。</p>\n\n<p><code>arr</code> 是一个由对象组成的数组或一个数组。数组中的每个项都可以包含深层嵌套的子数组和子对象。它还可以包含数字、字符串、布尔值和空值。</p>\n\n<p>矩阵 <code>m</code> 的第一行应该是列名。如果没有嵌套,列名是对象中的唯一键。如果存在嵌套,列名是对象中相应路径,以点号 <code>\".\"</code> 分隔。</p>\n\n<p>剩余的每一行对应 <code>arr</code> 中的一个对象。矩阵中的每个值对应对象中的一个值。如果给定对象在给定列中没有值,则应该包含空字符串 <code>\"\"</code> 。</p>\n\n<p>矩阵中的列应按 <strong>字典升序</strong> 排列。</p>\n\n<p> </p>\n\n<p><strong class=\"example\">示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>\narr = [\n {\"b\": 1, \"a\": 2},\n {\"b\": 3, \"a\": 4}\n]\n<b>输出:</b>\n[\n [\"a\", \"b\"],\n [2, 1],\n [4, 3]\n]\n\n<strong>解释:</strong>\n两个对象中有两个唯一的列名:\"a\"和\"b\"。 \n\"a\"对应[2, 4]。 \n\"b\"对应[1, 3]。\n</pre>\n\n<p><strong class=\"example\">示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>\narr = [\n {\"a\": 1, \"b\": 2},\n {\"c\": 3, \"d\": 4},\n {}\n]\n<b>输出:</b>\n[\n [\"a\", \"b\", \"c\", \"d\"],\n [1, 2, \"\", \"\"],\n [\"\", \"\", 3, 4],\n [\"\", \"\", \"\", \"\"]\n]\n\n<strong>解释:</strong>\n有四个唯一的列名:\"a\"、\"b\"、\"c\"、\"d\"。 \n 第一个对象具有与\"a\"和\"b\"关联的值。 \n第二个对象具有与\"c\"和\"d\"关联的值。 \n第三个对象没有键,因此只是一行空字符串。\n</pre>\n\n<p><strong class=\"example\">示例 3:</strong></p>\n\n<pre>\n<b>输入:</b>\narr = [\n {\"a\": {\"b\": 1, \"c\": 2}},\n {\"a\": {\"b\": 3, \"d\": 4}}\n]\n<b>输出:</b>\n[\n [\"a.b\", \"a.c\", \"a.d\"],\n [1, 2, \"\"],\n [3, \"\", 4]\n]\n\n<b>解释:</b>\n在这个例子中,对象是嵌套的。键表示每个值的完整路径,路径之间用句点分隔。 \n有三个路径:\"a.b\"、\"a.c\"、\"a.d\"。\n</pre>\n\n<p><strong class=\"example\">示例 4:</strong></p>\n\n<pre>\n<b>输入:</b>\narr = [\n [{\"a\": null}],\n [{\"b\": true}],\n [{\"c\": \"x\"}]\n]\n<strong>输出:</strong> \n[\n [\"0.a\", \"0.b\", \"0.c\"],\n [null, \"\", \"\"],\n [\"\", true, \"\"],\n [\"\", \"\", \"x\"]\n]\n\n<strong>解释:</strong>\n数组也被视为具有索引为键的对象。 \n每个数组只有一个元素,所以键是\"0.a\"、\"0.b\"和\"0.c\"。\n</pre>\n\n<p><strong class=\"example\">示例 5:</strong></p>\n\n<pre>\n<b>输入:</b>\narr = [\n {},\n {},\n {},\n]\n<b>输出:</b>\n[\n [],\n [],\n [],\n []\n]\n\n<strong>解释:</strong>\n没有键,所以每一行都是一个空数组。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr.length <= 1000</code></li>\n\t<li><code>unique keys <= 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": true, \"java\": true, \"python\": true, \"python3\": true, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"dart\": false}",
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @param {Array} arr\n * @return {Matrix}\n */\nvar jsonToMatrix = function(arr) {\n \n};",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "function jsonToMatrix(arr: any[]): (string | number | boolean | null)[] {\n\n};",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"54\", \"totalSubmission\": \"86\", \"totalAcceptedRaw\": 54, \"totalSubmissionRaw\": 86, \"acRate\": \"62.8%\"}",
|
||||
"hints": [
|
||||
"How could you split the problem up into sub-problems?",
|
||||
"1.) Write a function that converts a single object into a dictionary that maps the path name to values. You can solve this recursively by keeping track of current path list.",
|
||||
"2.) Write a function that converts a list of dictionaries into a matrix. Start by creating a list of all possible paths in any of the dictionaries. This will represent the columns."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "[{\"b\":1,\"a\":2},{\"b\":3,\"a\":4}]",
|
||||
"metaData": "{\n \"name\": \"jsonToMatrix\",\n \"params\": [\n {\n \"name\": \"arr\",\n \"type\": \"string\"\n }\n ],\n \"return\": {\n \"type\": \"string\"\n },\n \"languages\": [\n \"typescript\",\n \"javascript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"javascript\":[\"JavaScript\",\"<p>\\u7248\\u672c\\uff1a<code>Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a <code>--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f <a href=\\\"http:\\/\\/node.green\\/\\\" target=\\\"_blank\\\">\\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 4.5.4<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "[{\"b\":1,\"a\":2},{\"b\":3,\"a\":4}]\n[{\"a\":1,\"b\":2},{\"c\":3,\"d\":4},{}]\n[{\"a\":{\"b\":1,\"c\":2}},{\"a\":{\"b\":3,\"d\":4}}]\n[[{\"a\":null}],[{\"b\":true}],[{\"c\":\"x\"}]]\n[{},{},{}]",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
197
leetcode-cn/originData/binary-number-to-string-lcci.json
Normal file
197
leetcode-cn/originData/binary-number-to-string-lcci.json
Normal file
File diff suppressed because one or more lines are too long
59
leetcode-cn/originData/chunk-array.json
Normal file
59
leetcode-cn/originData/chunk-array.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2798",
|
||||
"questionFrontendId": "2677",
|
||||
"categoryTitle": "JavaScript",
|
||||
"boundTopicId": 2267105,
|
||||
"title": "Chunk Array",
|
||||
"titleSlug": "chunk-array",
|
||||
"content": "<p>Given an array <code>arr</code> and a chunk size <code>size</code>, return a <strong>chunked</strong> array. A <strong>chunked</strong> array contains the original elements in <code>arr</code>, but consists of subarrays each of length <code>size</code>. The length of the last subarray may be less than <code>size</code> if <code>arr.length</code> is not evenly divisible by <code>size</code>.</p>\n\n<p>You may assume the array is the output of <code>JSON.parse</code>. In other words, it is valid JSON.</p>\n\n<p>Please solve it without using lodash's <code>_.chunk</code> function.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> arr = [1,2,3,4,5], size = 1\n<strong>Output:</strong> [[1],[2],[3],[4],[5]]\n<strong>Explanation:</strong> The arr has been split into subarrays each with 1 element.\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> arr = [1,9,6,3,2], size = 3\n<strong>Output:</strong> [[1,9,6],[3,2]]\n<strong>Explanation:</strong> The arr has been split into subarrays with 3 elements. However, only two elements are left for the 2nd subarray.\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> arr = [8,5,3,2,6], size = 6\n<strong>Output:</strong> [[8,5,3,2,6]]\n<strong>Explanation:</strong> Size is greater than arr.length thus all elements are in the first subarray.\n</pre>\n\n<p><strong class=\"example\">Example 4:</strong></p>\n\n<pre>\n<strong>Input:</strong> arr = [], size = 1\n<strong>Output:</strong> []\n<strong>Explanation:</strong> There are no elements to be chunked so an empty array is returned.</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>arr is a valid JSON array</code></li>\n\t<li><code>2 <= JSON.stringify(arr).length <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= size <= arr.length + 1</code></li>\n</ul>\n",
|
||||
"translatedTitle": "分块数组",
|
||||
"translatedContent": "<p>给定一个数组 <code>arr</code> 和一个块大小 <code>size</code> ,返回一个 <strong>分块</strong> 的数组。<strong>分块</strong> 的数组包含了 <code>arr</code> 中的原始元素,但是每个子数组的长度都是 <code>size</code> 。如果 <code>arr.length</code> 不能被 <code>size</code> 整除,那么最后一个子数组的长度可能小于 <code>size</code> 。</p>\n\n<p>你可以假设该数组是 <code>JSON.parse</code> 的输出结果。换句话说,它是有效的JSON。</p>\n\n<p>请你在不使用 lodash 的函数 <code>_.chunk</code> 的情况下解决这个问题。</p>\n\n<p> </p>\n\n<p><strong class=\"example\">示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>arr = [1,2,3,4,5], size = 1\n<b>输出:</b>[[1],[2],[3],[4],[5]]\n<b>解释:</b>数组 <code>arr </code>被分割成了每个只有一个元素的子数组。\n</pre>\n\n<p><strong class=\"example\">示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>arr = [1,9,6,3,2], size = 3\n<b>输出:</b>[[1,9,6],[3,2]]\n<b>解释:</b>数组 <code>arr </code>被分割成了每个有三个元素的子数组。然而,第二个子数组只有两个元素。\n</pre>\n\n<p><strong class=\"example\">示例 3:</strong></p>\n\n<pre>\n<b>输入:</b>arr = [8,5,3,2,6], size = 6\n<b>输出:</b>[[8,5,3,2,6]]\n<b>解释:</b><code>size </code>大于 <code>arr.length </code>,因此所有元素都在第一个子数组中。\n</pre>\n\n<p><strong class=\"example\">示例 4:</strong></p>\n\n<pre>\n<b>输入:</b>arr = [], size = 1\n<b>输出:</b>[]\n<b>解释:</b>没有元素需要分块,因此返回一个空数组。</pre>\n\n<p> </p>\n\n<p><b>提示:</b></p>\n\n<ul>\n\t<li><code>arr is a valid JSON array</code></li>\n\t<li><code>2 <= JSON.stringify(arr).length <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= size <= arr.length + 1</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": true, \"java\": true, \"python\": true, \"python3\": true, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"dart\": false}",
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @param {Array} arr\n * @param {number} size\n * @return {Array[]}\n */\nvar chunk = function(arr, size) {\n \n};",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "function chunk(arr: any[], size: number): any[][] {\n\n};",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"153\", \"totalSubmission\": \"206\", \"totalAcceptedRaw\": 153, \"totalSubmissionRaw\": 206, \"acRate\": \"74.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "[1,2,3,4,5]\n1",
|
||||
"metaData": "{\n \"name\": \"chunkify\",\n \"params\": [\n {\n \"name\": \"arr\",\n \"type\": \"string\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"size\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"javascript\":[\"JavaScript\",\"<p>\\u7248\\u672c\\uff1a<code>Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a <code>--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f <a href=\\\"http:\\/\\/node.green\\/\\\" target=\\\"_blank\\\">\\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 4.5.4<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "[1,2,3,4,5]\n1\n[1,9,6,3,2]\n3\n[8,5,3,2,6]\n6\n[]\n1",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
161
leetcode-cn/originData/cnHoX6.json
Normal file
161
leetcode-cn/originData/cnHoX6.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
62
leetcode-cn/originData/counter-ii.json
Normal file
62
leetcode-cn/originData/counter-ii.json
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2789",
|
||||
"questionFrontendId": "2665",
|
||||
"categoryTitle": "JavaScript",
|
||||
"boundTopicId": 2258605,
|
||||
"title": "Counter II",
|
||||
"titleSlug": "counter-ii",
|
||||
"content": "<p>Write a function <code>createCounter</code>. It should accept an initial integer <code>init</code>. It should return an object with three functions.</p>\n\n<p>The three functions are:</p>\n\n<ul>\n\t<li><code>increment()</code> increases the current value by 1 and then returns it.</li>\n\t<li><code>decrement()</code> reduces the current value by 1 and then returns it.</li>\n\t<li><code>reset()</code> sets the current value to <code>init</code> and then returns it.</li>\n</ul>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> init = 5, calls = ["increment","reset","decrement"]\n<strong>Output:</strong> [6,5,4]\n<strong>Explanation:</strong>\nconst counter = createCounter(5);\ncounter.increment(); // 6\ncounter.reset(); // 5\ncounter.decrement(); // 4\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> init = 0, calls = ["increment","increment","decrement","reset","reset"]\n<strong>Output:</strong> [1,2,1,0,0]\n<strong>Explanation:</strong>\nconst counter = createCounter(0);\ncounter.increment(); // 1\ncounter.increment(); // 2\ncounter.decrement(); // 1\ncounter.reset(); // 0\ncounter.reset(); // 0\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>-1000 <= init <= 1000</code></li>\n\t<li><code>total calls not to exceed 1000</code></li>\n</ul>\n",
|
||||
"translatedTitle": "计数器 II",
|
||||
"translatedContent": "<p>请你写一个函数 <code>createCounter</code>. 这个函数接收一个初始的整数值 <code>init</code> 并返回一个包含三个函数的对象。</p>\n\n<p>这三个函数是:</p>\n\n<ul>\n\t<li><code>increment()</code> 将当前值加 1 并返回。</li>\n\t<li><code>decrement()</code> 将当前值减 1 并返回。</li>\n\t<li><code>reset()</code> 将当前值设置为 <code>init</code> 并返回。</li>\n</ul>\n\n<p> </p>\n\n<p><strong class=\"example\">示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>init = 5, calls = [\"increment\",\"reset\",\"decrement\"]\n<b>输出:</b>[6,5,4]\n<strong>解释:</strong>\nconst counter = createCounter(5);\ncounter.increment(); // 6\ncounter.reset(); // 5\ncounter.decrement(); // 4\n</pre>\n\n<p><strong class=\"example\">示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>init = 0, calls = [\"increment\",\"increment\",\"decrement\",\"reset\",\"reset\"]\n<b>输出:</b>[1,2,1,0,0]\n<strong>解释:</strong>\nconst counter = createCounter(0);\ncounter.increment(); // 1\ncounter.increment(); // 2\ncounter.decrement(); // 1\ncounter.reset(); // 0\ncounter.reset(); // 0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>-1000 <= init <= 1000</code></li>\n\t<li><code>总调用次数不会超过 1000</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": false, \"java\": true, \"python\": true, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"dart\": false}",
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @param {integer} init\n * @return { increment: Function, decrement: Function, reset: Function }\n */\nvar createCounter = function(init) {\n \n};\n\n/**\n * const counter = createCounter(5)\n * counter.increment(); // 6\n * counter.reset(); // 5\n * counter.decrement(); // 4\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "type ReturnObj = {\n increment: () => number,\n decrement: () => number,\n reset: () => number,\n}\n\nfunction createCounter(init: number): ReturnObj {\n\n};\n\n/**\n * const counter = createCounter(5)\n * counter.increment(); // 6\n * counter.reset(); // 5\n * counter.decrement(); // 4\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"402\", \"totalSubmission\": \"512\", \"totalAcceptedRaw\": 402, \"totalSubmissionRaw\": 512, \"acRate\": \"78.5%\"}",
|
||||
"hints": [
|
||||
"You can return an object with methods.",
|
||||
"Initialize a variable for currentCount. Inside these methods, add the appropriate logic which mutates currentCount."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "5\n[\"increment\",\"reset\",\"decrement\"]",
|
||||
"metaData": "{\n \"name\": \"createCounter\",\n \"params\": [\n {\n \"name\": \"init\",\n \"type\": \"integer\"\n },\n {\n \"type\": \"string[]\",\n \"name\": \"calls\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"javascript\":[\"JavaScript\",\"<p>\\u7248\\u672c\\uff1a<code>Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a <code>--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f <a href=\\\"http:\\/\\/node.green\\/\\\" target=\\\"_blank\\\">\\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 4.5.4<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "5\n[\"increment\",\"reset\",\"decrement\"]\n0\n[\"increment\",\"increment\",\"decrement\",\"reset\",\"reset\"]",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
59
leetcode-cn/originData/create-hello-world-function.json
Normal file
59
leetcode-cn/originData/create-hello-world-function.json
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2809",
|
||||
"questionFrontendId": "2667",
|
||||
"categoryTitle": "JavaScript",
|
||||
"boundTopicId": 2255550,
|
||||
"title": "Create Hello World Function",
|
||||
"titleSlug": "create-hello-world-function",
|
||||
"content": "Write a function <code>createHelloWorld</code>. It should return a new function that always returns <code>"Hello World"</code>.\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> args = []\n<strong>Output:</strong> "Hello World"\n<strong>Explanation:</strong>\nconst f = createHelloWorld();\nf(); // "Hello World"\n\nThe function returned by createHelloWorld should always return "Hello World".\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> args = [{},null,42]\n<strong>Output:</strong> "Hello World"\n<strong>Explanation:</strong>\nconst f = createHelloWorld();\nf({}, null, 42); // "Hello World"\n\nAny arguments could be passed to the function but it should still always return "Hello World".\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>0 <= args.length <= 10</code></li>\n</ul>\n",
|
||||
"translatedTitle": "创建 Hello World 函数",
|
||||
"translatedContent": "请你编写一个名为 <code>createHelloWorld</code> 的函数。它应该返回一个新的函数,该函数总是返回 <code>\"Hello World\"</code> 。\n<p> </p>\n\n<p><strong class=\"example\">示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>args = []\n<b>输出:</b>\"Hello World\"\n<strong>解释:</strong>\nconst f = createHelloWorld();\nf(); // \"Hello World\"\n\ncreateHelloWorld 返回的函数应始终返回 \"Hello World\"。\n</pre>\n\n<p><strong class=\"example\">示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>args = [{},null,42]\n<b>输出:</b>\"Hello World\"\n<strong>解释:</strong>\nconst f = createHelloWorld();\nf({}, null, 42); // \"Hello World\"\n\n可以传递任何参数给函数,但它应始终返回 \"Hello World\"。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= args.length <= 10</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 1,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": true, \"java\": true, \"python\": true, \"python3\": true, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"dart\": false}",
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @return {Function}\n */\nvar createHelloWorld = function() {\n return function(...args) {\n \n }\n};\n\n/**\n * const f = createHelloWorld();\n * f(); // \"Hello World\"\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "function createHelloWorld() {\n\treturn function(...args): string {\n \n };\n};\n\n/**\n * const f = createHelloWorld();\n * f(); // \"Hello World\"\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"520\", \"totalSubmission\": \"584\", \"totalAcceptedRaw\": 520, \"totalSubmissionRaw\": 584, \"acRate\": \"89.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "[]",
|
||||
"metaData": "{\n \"name\": \"createHelloWorld\",\n \"params\": [\n {\n \"name\": \"args\",\n \"type\": \"string\"\n }\n ],\n \"return\": {\n \"type\": \"string\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"javascript\":[\"JavaScript\",\"<p>\\u7248\\u672c\\uff1a<code>Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a <code>--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f <a href=\\\"http:\\/\\/node.green\\/\\\" target=\\\"_blank\\\">\\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 4.5.4<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "[]\n[{},null,42]",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
177
leetcode-cn/originData/find-the-distinct-difference-array.json
Normal file
177
leetcode-cn/originData/find-the-distinct-difference-array.json
Normal file
File diff suppressed because one or more lines are too long
163
leetcode-cn/originData/find-the-losers-of-the-circular-game.json
Normal file
163
leetcode-cn/originData/find-the-losers-of-the-circular-game.json
Normal file
File diff suppressed because one or more lines are too long
178
leetcode-cn/originData/frequency-tracker.json
Normal file
178
leetcode-cn/originData/frequency-tracker.json
Normal file
File diff suppressed because one or more lines are too long
168
leetcode-cn/originData/kjpLFZ.json
Normal file
168
leetcode-cn/originData/kjpLFZ.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
164
leetcode-cn/originData/maximum-number-of-moves-in-a-grid.json
Normal file
164
leetcode-cn/originData/maximum-number-of-moves-in-a-grid.json
Normal file
File diff suppressed because one or more lines are too long
164
leetcode-cn/originData/maximum-or.json
Normal file
164
leetcode-cn/originData/maximum-or.json
Normal file
File diff suppressed because one or more lines are too long
164
leetcode-cn/originData/neighboring-bitwise-xor.json
Normal file
164
leetcode-cn/originData/neighboring-bitwise-xor.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
164
leetcode-cn/originData/number-of-senior-citizens.json
Normal file
164
leetcode-cn/originData/number-of-senior-citizens.json
Normal file
File diff suppressed because one or more lines are too long
166
leetcode-cn/originData/power-of-heroes.json
Normal file
166
leetcode-cn/originData/power-of-heroes.json
Normal file
File diff suppressed because one or more lines are too long
161
leetcode-cn/originData/qoQAMX.json
Normal file
161
leetcode-cn/originData/qoQAMX.json
Normal file
File diff suppressed because one or more lines are too long
161
leetcode-cn/originData/ryfUiz.json
Normal file
161
leetcode-cn/originData/ryfUiz.json
Normal file
File diff suppressed because one or more lines are too long
164
leetcode-cn/originData/sum-in-a-matrix.json
Normal file
164
leetcode-cn/originData/sum-in-a-matrix.json
Normal file
File diff suppressed because one or more lines are too long
63
leetcode-cn/originData/throttle.json
Normal file
63
leetcode-cn/originData/throttle.json
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2771",
|
||||
"questionFrontendId": "2676",
|
||||
"categoryTitle": "JavaScript",
|
||||
"boundTopicId": 2267103,
|
||||
"title": "Throttle",
|
||||
"titleSlug": "throttle",
|
||||
"content": "<p>Given a function <code>fn</code> and a time in milliseconds <code>t</code>, return a <strong>throttled</strong> version of that function.</p>\n\n<p>A <strong>throttled</strong> function is first called without delay and then, for a time interval of <code>t</code> milliseconds, can't be executed but should store the latest function arguments provided to call <code>fn</code> with them after the end of the delay.</p>\n\n<p>For instance, <code>t = 50ms</code>, and the function was called at <code>30ms</code>, <code>40ms</code>, and <code>60ms</code>. The first function call would block calling functions for the following <code>t</code> milliseconds. The second function call would save arguments, and the third call arguments should overwrite currently stored arguments from the second call because the second and third calls are called before <code>80ms</code>. Once the delay has passed, the throttled function should be called with the latest arguments provided during the delay period, and it should also create another delay period of <code>80ms + t</code>.</p>\n\n<p><img alt=\"Throttle Diagram\" src=\"https://assets.leetcode.com/uploads/2023/04/08/screen-shot-2023-04-08-at-120313-pm.png\" style=\"width: 1156px; height: 372px;\" />The above diagram shows how throttle will transform events. Each rectangle represents 100ms and the throttle time is 400ms. Each color represents a different set of inputs.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> t = 100, calls = [{"t":20,"inputs":[1]}]\n<strong>Output:</strong> [{"t":20,"inputs":[1]}]\n<strong>Explanation:</strong> The 1st call is always called without delay\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> t = 50, calls = [{"t":50,"inputs":[1]},{"t":75,"inputs":[2]}]\n<strong>Output:</strong> [{"t":50,"inputs":[1]},{"t":100,"inputs":[2]}]\n<strong>Explanation:</strong> \nThe 1st is called a function with arguments (1) without delay.\nThe 2nd is called at 75ms, within the delay period because 50ms + 50ms = 100ms, so the next call can be reached at 100ms. Therefore, we save arguments from the 2nd call to use them at the callback of the 1st call.\n</pre>\n\n<p><strong class=\"example\">Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> t = 70, calls = [{"t":50,"inputs":[1]},{"t":75,"inputs":[2]},{"t":90,"inputs":[8]},{"t": 140, "inputs":[5,7]},{"t": 300, "inputs": [9,4]}]\n<strong>Output:</strong> [{"t":50,"inputs":[1]},{"t":120,"inputs":[8]},{"t":190,"inputs":[5,7]},{"t":300,"inputs":[9,4]}]\n<strong>Explanation:</strong> \nThe 1st is called a function with arguments (1) without delay.\nThe 2nd is called at 75ms within the delay period because 50ms + 70ms = 120ms, so it should only save arguments. \nThe 3rd is also called within the delay period, and because we need just the latest function arguments, we overwrite previous ones. After the delay period, we do a callback at 120ms with saved arguments. That callback makes another delay period of 120ms + 70ms = 190ms so that the next function can be called at 190ms.\nThe 4th is called at 140ms in the delay period, so it should be called as a callback at 190ms. That will create another delay period of 190ms + 70ms = 260ms.\nThe 5th is called at 300ms, but it is after 260ms, so it should be called immediately and should create another delay period of 300ms + 70ms = 370ms.</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>0 <= t <= 1000</code></li>\n\t<li><code>1 <= calls.length <= 10</code></li>\n\t<li><code>0 <= calls[i].t <= 1000</code></li>\n\t<li><code>0 <= calls[i].inputs[i], calls[i].inputs.length <= 10</code></li>\n</ul>\n",
|
||||
"translatedTitle": "节流",
|
||||
"translatedContent": "<p>现给定一个函数 <code>fn</code> 和一个以毫秒为单位的时间 <code>t</code> ,请你返回该函数的 <strong>节流</strong> 版本。</p>\n\n<p><strong>节流</strong> 函数首先立即被调用,然后在 <code>t</code> 毫秒的时间间隔内不能再次执行,但应该存储最新的函数参数,以便在延迟结束后使用这些参数调用 <code>fn</code> 。</p>\n\n<p>例如,<code>t = 50ms</code> ,并且函数在 <code>30ms</code> 、 <code>40ms</code> 和 <code>60ms</code> 时被调用。第一次函数调用会在接下来的 <code>t</code> 毫秒内阻止调用函数。第二次函数调用会保存参数,而第三次调用的参数应该覆盖当前保存的第二次调用的参数,因为第二次和第三次调用发生在 <code>80ms</code> 之前。一旦延迟时间过去,节流函数应该使用延迟期间提供的最新参数进行调用,并且还应创建另一个延迟期间,时长为 <code>80ms + t</code> 。</p>\n\n<p><img alt=\"Throttle Diagram\" src=\"https://assets.leetcode.com/uploads/2023/04/08/screen-shot-2023-04-08-at-120313-pm.png\" style=\"width: 1156px; height: 372px;\" />上面的图示展示了节流如何转换事件。每个矩形代表100毫秒,节流时间为400毫秒。每种颜色代表不同的输入集合。</p>\n\n<p> </p>\n\n<p><strong class=\"example\">示例 1:</strong></p>\n\n<pre>\n<b>输入:</b>t = 100, calls = [{\"t\":20,\"inputs\":[1]}]\n<b>输出:</b>[{\"t\":20,\"inputs\":[1]}]\n<b>解释:</b>第一次调用总是立即执行,没有延迟。\n</pre>\n\n<p><strong class=\"example\">示例 2:</strong></p>\n\n<pre>\n<b>输入:</b>t = 50, calls = [{\"t\":50,\"inputs\":[1]},{\"t\":75,\"inputs\":[2]}]\n<b>输出:</b>[{\"t\":50,\"inputs\":[1]},{\"t\":100,\"inputs\":[2]}]\n<b>解释:</b>\n第一次调用立即执行带有参数 (1) 的函数。 \n第二次调用发生在 75毫秒 时,在延迟期间内,因为 50毫秒 + 50毫秒 = 100毫秒,所以下一次调用可以在 100毫秒 时执行。因此,我们保存第二次调用的参数,以便在第一次调用的回调函数中使用。\n</pre>\n\n<p><strong class=\"example\">示例 3:</strong></p>\n\n<pre>\n<b>输入:</b>t = 70, calls = [{\"t\":50,\"inputs\":[1]},{\"t\":75,\"inputs\":[2]},{\"t\":90,\"inputs\":[8]},{\"t\": 140, \"inputs\":[5,7]},{\"t\": 300, \"inputs\": [9,4]}]\n<b>输出:</b>[{\"t\":50,\"inputs\":[1]},{\"t\":120,\"inputs\":[8]},{\"t\":190,\"inputs\":[5,7]},{\"t\":300,\"inputs\":[9,4]}]\n<b>解释:</b>\n第一次调用立即执行带有参数 (1) 的函数。 \n第二次调用发生在 75毫秒 时,在延迟期间内,因为 50毫秒 + 70毫秒 = 120毫秒,所以它只应保存参数。 \n第三次调用也在延迟期间内,因为我们只需要最新的函数参数,所以覆盖之前的参数。延迟期过后,在 120毫秒时进行回调,并使用保存的参数进行调用。该回调会创建另一个延迟期间,时长为 120毫秒 + 70毫秒 = 190毫秒,以便下一个函数可以在 190毫秒时调用。 \n第四次调用发生在 140毫秒,在延迟期间内,因此应在190毫秒时作为回调进行调用。这将创建另一个延迟期间,时长为 190毫秒 + 70毫秒 = 260毫秒。 \n第五次调用发生在 300毫秒,但它是在 260毫秒 之后,所以应立即调用,并创建另一个延迟期间,时长为 300毫秒 + 70毫秒 = 370毫秒。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= t <= 1000</code></li>\n\t<li><code>1 <= calls.length <= 10</code></li>\n\t<li><code>0 <= calls[i].t <= 1000</code></li>\n\t<li><code>0 <= calls[i].inputs[i], calls[i].inputs.length <= 10</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 0,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"contributors": [],
|
||||
"langToValidPlayground": "{\"cpp\": true, \"java\": true, \"python\": true, \"python3\": true, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"dart\": false}",
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @param {Function} fn\n * @param {number} t\n * @return {Function}\n */\nvar throttle = function(fn, t) {\n return function(...args) {\n\n }\n};\n\n/**\n * const throttled = throttle(console.log, 100);\n * throttled(\"log\"); // logged immediately.\n * throttled(\"log\"); // logged at t=100ms.\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "type F = (...args: any[]) => void\n\nfunction throttle(fn: F, t: number): F {\n return function (...args) {\n\n }\n};\n\n/**\n * const throttled = throttle(console.log, 100);\n * throttled(\"log\"); // logged immediately.\n * throttled(\"log\"); // logged at t=100ms.\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"86\", \"totalSubmission\": \"182\", \"totalAcceptedRaw\": 86, \"totalSubmissionRaw\": 182, \"acRate\": \"47.3%\"}",
|
||||
"hints": [
|
||||
"Store a variable for currArguments.",
|
||||
"If no timeout is in progress, immediately execute the function and create a timeout. If a timeout is in progress, set the currArguments to the new arguments.",
|
||||
"When the timeout is done: if currArguments is null, do nothing. Otherwise, execute the function with currArguments and create another timeout."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "100\n[{\"t\":20,\"inputs\":[1]}]",
|
||||
"metaData": "{\n \"name\": \"throttle\",\n \"params\": [\n {\n \"name\": \"fn\",\n \"type\": \"string\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"t\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"envInfo": "{\"javascript\":[\"JavaScript\",\"<p>\\u7248\\u672c\\uff1a<code>Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a <code>--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f <a href=\\\"http:\\/\\/node.green\\/\\\" target=\\\"_blank\\\">\\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 4.5.4<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
|
||||
"book": null,
|
||||
"isSubscribed": false,
|
||||
"isDailyQuestion": false,
|
||||
"dailyRecordStatus": null,
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "100\n[{\"t\":20,\"inputs\":[1]}]\n50\n[{\"t\":50,\"inputs\":[1]},{\"t\":75,\"inputs\":[2]}]\n70\n[{\"t\":50,\"inputs\":[1]},{\"t\":75,\"inputs\":[2]},{\"t\":90,\"inputs\":[8]},{\"t\": 140, \"inputs\":[5,7]},{\"t\": 300, \"inputs\": [9,4]}]",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user