{ "data": { "question": { "questionId": "2750", "questionFrontendId": "2636", "categoryTitle": "JavaScript", "boundTopicId": 2222268, "title": "Promise Pool", "titleSlug": "promise-pool", "content": null, "translatedTitle": "Promise 对象池", "translatedContent": null, "isPaidOnly": true, "difficulty": "Medium", "likes": 16, "dislikes": 0, "isLiked": null, "similarQuestions": "[{\"title\": \"Sleep\", \"titleSlug\": \"sleep\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u7761\\u7720\\u51fd\\u6570\", \"isPaidOnly\": false}, {\"title\": \"Promise Time Limit\", \"titleSlug\": \"promise-time-limit\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u6709\\u65f6\\u95f4\\u9650\\u5236\\u7684 Promise \\u5bf9\\u8c61\", \"isPaidOnly\": false}, {\"title\": \"Cache With Time Limit\", \"titleSlug\": \"cache-with-time-limit\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u6709\\u65f6\\u95f4\\u9650\\u5236\\u7684\\u7f13\\u5b58\", \"isPaidOnly\": false}, {\"title\": \"Throttle\", \"titleSlug\": \"throttle\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u8282\\u6d41\", \"isPaidOnly\": true}]", "contributors": [], "langToValidPlayground": null, "topicTags": [], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"1.8K\", \"totalSubmission\": \"2.8K\", \"totalAcceptedRaw\": 1841, \"totalSubmissionRaw\": 2796, \"acRate\": \"65.8%\"}", "hints": [ "Initially execute all the functions until the queue fills up.", "Every time a function resolves, add a new promise to the queue if possible." ], "solution": null, "status": null, "sampleTestCase": "[() => new Promise(res => setTimeout(res, 300)), () => new Promise(res => setTimeout(res, 400)), () => new Promise(res => setTimeout(res, 200))]\n2", "metaData": "{\n \"name\": \"promisePool\",\n \"params\": [\n {\n \"name\": \"functions\",\n \"type\": \"string\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"n\"\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\",\"
\\u7248\\u672c\\uff1a \\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n \\u60a8\\u53ef\\u4f7f\\u7528 datastructures-js <\\/a>\\u5e93\\u6240\\u63d0\\u4f9b\\u7684\\u6570\\u636e\\u7ed3\\u6784\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\" TypeScript 5.7.3<\\/p>\\r\\n\\r\\n Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2024<\\/p>\\r\\n\\r\\n lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\nNode.js 22.14.0<\\/code><\\/p>\\r\\n\\r\\n--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f \\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n