mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
54 lines
4.1 KiB
JSON
54 lines
4.1 KiB
JSON
{
|
|
"data": {
|
|
"question": {
|
|
"questionId": "2768",
|
|
"questionFrontendId": "2774",
|
|
"boundTopicId": null,
|
|
"title": "Array Upper Bound",
|
|
"titleSlug": "array-upper-bound",
|
|
"content": null,
|
|
"translatedTitle": null,
|
|
"translatedContent": null,
|
|
"isPaidOnly": true,
|
|
"difficulty": "Easy",
|
|
"likes": 15,
|
|
"dislikes": 1,
|
|
"isLiked": null,
|
|
"similarQuestions": "[{\"title\": \"Array Prototype Last\", \"titleSlug\": \"array-prototype-last\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"Group By\", \"titleSlug\": \"group-by\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Snail Traversal\", \"titleSlug\": \"snail-traversal\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
|
|
"exampleTestcases": "[3,4,5]\n5\n[1,4,5]\n2\n[3,4,6,6,6,6,7]\n6",
|
|
"categoryTitle": "JavaScript",
|
|
"contributors": [],
|
|
"topicTags": [],
|
|
"companyTagStats": null,
|
|
"codeSnippets": null,
|
|
"stats": "{\"totalAccepted\": \"751\", \"totalSubmission\": \"916\", \"totalAcceptedRaw\": 751, \"totalSubmissionRaw\": 916, \"acRate\": \"82.0%\"}",
|
|
"hints": [
|
|
"Inside the Array.prototype.upperBound function you have access to the \"this\" keyword. You can access array elements, values, and methods. For example \"this[0]\", \"this[1]\", \"this.length\", \"this.map()\", etc.",
|
|
"The most efficient way to solve this problem is with binary search.",
|
|
"Choose the middle element and check if it's less than or equal to the goal value. If so, you can rule out the left side of the array."
|
|
],
|
|
"solution": {
|
|
"id": "2115",
|
|
"canSeeDetail": true,
|
|
"paidOnly": false,
|
|
"hasVideoSolution": false,
|
|
"paidOnlyVideo": true,
|
|
"__typename": "ArticleNode"
|
|
},
|
|
"status": null,
|
|
"sampleTestCase": "[3,4,5]\n5",
|
|
"metaData": "{\n \"name\": \"upperBound\",\n \"params\": [\n {\n \"name\": \"nums\",\n \"type\": \"integer[]\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"target\"\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,
|
|
"enableTestMode": false,
|
|
"enableDebugger": false,
|
|
"envInfo": "{\"javascript\": [\"JavaScript\", \"<p><code>Node.js 16.13.2</code>.</p>\\r\\n\\r\\n<p>Your code is run with <code>--harmony</code> flag, enabling <a href=\\\"http://node.green/\\\" target=\\\"_blank\\\">new ES6 features</a>.</p>\\r\\n\\r\\n<p><a href=\\\"https://lodash.com\\\" target=\\\"_blank\\\">lodash.js</a> library is included by default.</p>\\r\\n\\r\\n<p>For Priority Queue / Queue data structures, you may use 5.3.0 version of <a href=\\\"https://github.com/datastructures-js/priority-queue/tree/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\">datastructures-js/priority-queue</a> and 4.2.1 version of <a href=\\\"https://github.com/datastructures-js/queue/tree/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\">datastructures-js/queue</a>.</p>\"], \"typescript\": [\"Typescript\", \"<p><code>TypeScript 5.1.6, Node.js 16.13.2</code>.</p>\\r\\n\\r\\n<p>Your code is run with <code>--harmony</code> flag, enabling <a href=\\\"http://node.green/\\\" target=\\\"_blank\\\">new ES2022 features</a>.</p>\\r\\n\\r\\n<p><a href=\\\"https://lodash.com\\\" target=\\\"_blank\\\">lodash.js</a> library is included by default.</p>\"]}",
|
|
"libraryUrl": null,
|
|
"adminUrl": null,
|
|
"challengeQuestion": null,
|
|
"__typename": "QuestionNode"
|
|
}
|
|
}
|
|
} |