mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
first commit
This commit is contained in:
commit
19f9daa313
130
1.py
Normal file
130
1.py
Normal file
@ -0,0 +1,130 @@
|
||||
# coding:utf-8
|
||||
import re
|
||||
import json
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import requests
|
||||
from requests.exceptions import RequestException
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
import random
|
||||
|
||||
def get_proble_set(url):
|
||||
try:
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
return response.text
|
||||
return None
|
||||
except RequestException:
|
||||
return None
|
||||
|
||||
def parse_proble_set(problemSet):
|
||||
# print(len(problemSet)) # 2218
|
||||
# for i in range(len(problemSet)):
|
||||
for i in range(930, len(problemSet)):
|
||||
title = problemSet[i]["stat"]["question__title_slug"]
|
||||
if os.path.exists("[no content]{}.json".format(title)) or os.path.exists("{}.json".format(title)):
|
||||
print(i, "has been parsed.")
|
||||
# print("The question has been parsed: {}".format(title))
|
||||
continue
|
||||
#construct_url(title)
|
||||
# time.sleep(0.5)
|
||||
time.sleep(1)
|
||||
# time.sleep(random.randint(0,9) / 10)
|
||||
t =threading.Thread(target=construct_url,args=(title,))
|
||||
t.start()
|
||||
|
||||
print(i, "is done.")
|
||||
continue
|
||||
|
||||
def construct_url(problemTitle):
|
||||
url = "https://leetcode.com/problems/"+ problemTitle + "/description/"
|
||||
# print(url)
|
||||
get_proble_content(url,problemTitle)
|
||||
|
||||
def save_problem(title,content):
|
||||
#content = bytes(content,encoding = 'utf8')
|
||||
filename = title + ".html"
|
||||
with open(filename,'w+',encoding="utf-8")as f:
|
||||
f.write(content)
|
||||
|
||||
def get_proble_content(problemUrl,title):
|
||||
response = requests.get(problemUrl)
|
||||
setCookie = response.headers["Set-Cookie"]
|
||||
'''
|
||||
print(setCookie)
|
||||
setCookie = json.loads(setCookie)
|
||||
print(type(setCookie))
|
||||
'''
|
||||
try:
|
||||
pattern = re.compile("csrftoken=(.*?);.*?",re.S)
|
||||
csrftoken = re.search(pattern, setCookie)
|
||||
url = "https://leetcode.com/graphql"
|
||||
data = {
|
||||
#"operationName":"getQuestionDetail",
|
||||
"operationName":"questionData",
|
||||
"variables":{"titleSlug":title},
|
||||
# "query":"query getQuestionDetail($titleSlug: String!) {\n isCurrentUserAuthenticated\n question(titleSlug: $titleSlug) {\n questionId\n questionFrontendId\n questionTitle\n translatedTitle\n questionTitleSlug\n content\n translatedContent\n difficulty\n stats\n allowDiscuss\n contributors\n similarQuestions\n mysqlSchemas\n randomQuestionUrl\n sessionId\n categoryTitle\n submitUrl\n interpretUrl\n codeDefinition\n sampleTestCase\n enableTestMode\n metaData\n enableRunCode\n enableSubmit\n judgerAvailable\n infoVerified\n envInfo\n urlManager\n article\n questionDetailUrl\n libraryUrl\n companyTags {\n name\n slug\n translatedName\n __typename\n }\n companyTagStats\n topicTags {\n name\n slug\n translatedName\n __typename\n }\n __typename\n }\n interviewed {\n interviewedUrl\n companies {\n id\n name\n slug\n __typename\n }\n timeOptions {\n id\n name\n __typename\n }\n stageOptions {\n id\n name\n __typename\n }\n __typename\n }\n subscribeUrl\n isPremium\n loginUrl\n}\n"
|
||||
"query": "query questionData($titleSlug: String!) {\n question(titleSlug: $titleSlug) {\n questionId\n questionFrontendId\n boundTopicId\n title\n titleSlug\n content\n translatedTitle\n translatedContent\n isPaidOnly\n difficulty\n likes\n dislikes\n isLiked\n similarQuestions\n exampleTestcases\n categoryTitle\n contributors {\n username\n profileUrl\n avatarUrl\n __typename\n }\n topicTags {\n name\n slug\n translatedName\n __typename\n }\n companyTagStats\n codeSnippets {\n lang\n langSlug\n code\n __typename\n }\n stats\n hints\n solution {\n id\n canSeeDetail\n paidOnly\n hasVideoSolution\n paidOnlyVideo\n __typename\n }\n status\n sampleTestCase\n metaData\n judgerAvailable\n judgeType\n mysqlSchemas\n enableRunCode\n enableTestMode\n enableDebugger\n envInfo\n libraryUrl\n adminUrl\n challengeQuestion {\n id\n date\n incompleteChallengeCount\n streakCount\n type\n __typename\n }\n __typename\n }\n}\n"
|
||||
}
|
||||
headers = {
|
||||
'x-csrftoken': csrftoken.group(1),
|
||||
'referer':problemUrl,
|
||||
'content-type':'application/json',
|
||||
'origin':'https://leetcode.com',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36'
|
||||
}
|
||||
cookies = {
|
||||
'__cfduid':'d9ce37537c705e759f6bea15fffc9c58b1525271602',
|
||||
'_ga':'GA1.2.5783653.1525271604',
|
||||
'_gid':'GA1.2.344320119.1533189808',
|
||||
'csrftoken':csrftoken.group(1),
|
||||
' _gat':'1'
|
||||
}
|
||||
#payload表单为json格式
|
||||
|
||||
dumpJsonData = json.dumps(data)
|
||||
response = requests.post(url,data = dumpJsonData, headers = headers,cookies = cookies)
|
||||
dictInfo = json.loads(response.text)
|
||||
if dictInfo["data"]["question"].get("content") is not None:
|
||||
saveJSON(dictInfo, title + ".json")
|
||||
content = dictInfo["data"]["question"]["content"]
|
||||
save_problem(title,content)
|
||||
# soup = BeautifulSoup(content, 'lxml')
|
||||
# save_problem(title,soup.prettify())
|
||||
else:
|
||||
saveJSON(dictInfo, "[no content]" + title + ".json")
|
||||
# print("no content")
|
||||
except Exception as e:
|
||||
print("[error] ", e, problemUrl)
|
||||
|
||||
def saveJSON(data, filename):
|
||||
with open(filename, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
|
||||
def main():
|
||||
# url = "https://leetcode.com/api/problems/all/"
|
||||
# html = json.loads(get_proble_set(url))
|
||||
# problemset = html["stat_status_pairs"]
|
||||
# saveJSON(html, "[en]json1-origin-data.json")
|
||||
# saveJSON(problemset, "[en]json2-problemset.json")
|
||||
|
||||
# url = "https://leetcode-cn.com/api/problems/all/"
|
||||
# html = json.loads(get_proble_set(url))
|
||||
# problemset = html["stat_status_pairs"]
|
||||
# saveJSON(html, "[cn]json1-origin-data.json")
|
||||
# saveJSON(problemset, "[cn]json2-problemset.json")
|
||||
# exit()
|
||||
|
||||
problemset = json.load(open("[en]json2-problemset.json", 'r', encoding='utf-8'))
|
||||
parse_proble_set(problemset)
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
if os.path.exists("算法题"):
|
||||
os.chdir("算法题")
|
||||
else:
|
||||
os.mkdir("算法题")
|
||||
os.chdir("算法题")
|
||||
main()
|
30
算法题/01-matrix.html
Normal file
30
算法题/01-matrix.html
Normal file
@ -0,0 +1,30 @@
|
||||
<p>Given an <code>m x n</code> binary matrix <code>mat</code>, return <em>the distance of the nearest </em><code>0</code><em> for each cell</em>.</p>
|
||||
|
||||
<p>The distance between two adjacent cells is <code>1</code>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/04/24/01-1-grid.jpg" style="width: 253px; height: 253px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> mat = [[0,0,0],[0,1,0],[0,0,0]]
|
||||
<strong>Output:</strong> [[0,0,0],[0,1,0],[0,0,0]]
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2021/04/24/01-2-grid.jpg" style="width: 253px; height: 253px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> mat = [[0,0,0],[0,1,0],[1,1,1]]
|
||||
<strong>Output:</strong> [[0,0,0],[0,1,0],[1,2,1]]
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>m == mat.length</code></li>
|
||||
<li><code>n == mat[i].length</code></li>
|
||||
<li><code>1 <= m, n <= 10<sup>4</sup></code></li>
|
||||
<li><code>1 <= m * n <= 10<sup>4</sup></code></li>
|
||||
<li><code>mat[i][j]</code> is either <code>0</code> or <code>1</code>.</li>
|
||||
<li>There is at least one <code>0</code> in <code>mat</code>.</li>
|
||||
</ul>
|
184
算法题/01-matrix.json
Normal file
184
算法题/01-matrix.json
Normal file
File diff suppressed because one or more lines are too long
35
算法题/1-bit-and-2-bit-characters.html
Normal file
35
算法题/1-bit-and-2-bit-characters.html
Normal file
@ -0,0 +1,35 @@
|
||||
<p>We have two special characters:</p>
|
||||
|
||||
<ul>
|
||||
<li>The first character can be represented by one bit <code>0</code>.</li>
|
||||
<li>The second character can be represented by two bits (<code>10</code> or <code>11</code>).</li>
|
||||
</ul>
|
||||
|
||||
<p>Given a binary array <code>bits</code> that ends with <code>0</code>, return <code>true</code> if the last character must be a one-bit character.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> bits = [1,0,0]
|
||||
<strong>Output:</strong> true
|
||||
<strong>Explanation:</strong> The only way to decode it is two-bit character and one-bit character.
|
||||
So the last character is one-bit character.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> bits = [1,1,1,0]
|
||||
<strong>Output:</strong> false
|
||||
<strong>Explanation:</strong> The only way to decode it is two-bit character and two-bit character.
|
||||
So the last character is not one-bit character.
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= bits.length <= 1000</code></li>
|
||||
<li><code>bits[i]</code> is either <code>0</code> or <code>1</code>.</li>
|
||||
</ul>
|
161
算法题/1-bit-and-2-bit-characters.json
Normal file
161
算法题/1-bit-and-2-bit-characters.json
Normal file
File diff suppressed because one or more lines are too long
37
算法题/132-pattern.html
Normal file
37
算法题/132-pattern.html
Normal file
@ -0,0 +1,37 @@
|
||||
<p>Given an array of <code>n</code> integers <code>nums</code>, a <strong>132 pattern</strong> is a subsequence of three integers <code>nums[i]</code>, <code>nums[j]</code> and <code>nums[k]</code> such that <code>i < j < k</code> and <code>nums[i] < nums[k] < nums[j]</code>.</p>
|
||||
|
||||
<p>Return <em><code>true</code> if there is a <strong>132 pattern</strong> in <code>nums</code>, otherwise, return <code>false</code>.</em></p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [1,2,3,4]
|
||||
<strong>Output:</strong> false
|
||||
<strong>Explanation:</strong> There is no 132 pattern in the sequence.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [3,1,4,2]
|
||||
<strong>Output:</strong> true
|
||||
<strong>Explanation:</strong> There is a 132 pattern in the sequence: [1, 4, 2].
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 3:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [-1,3,2,0]
|
||||
<strong>Output:</strong> true
|
||||
<strong>Explanation:</strong> There are three 132 patterns in the sequence: [-1, 3, 2], [-1, 3, 0] and [-1, 2, 0].
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>n == nums.length</code></li>
|
||||
<li><code>1 <= n <= 2 * 10<sup>5</sup></code></li>
|
||||
<li><code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code></li>
|
||||
</ul>
|
190
算法题/132-pattern.json
Normal file
190
算法题/132-pattern.json
Normal file
File diff suppressed because one or more lines are too long
34
算法题/2-keys-keyboard.html
Normal file
34
算法题/2-keys-keyboard.html
Normal file
@ -0,0 +1,34 @@
|
||||
<p>There is only one character <code>'A'</code> on the screen of a notepad. You can perform two operations on this notepad for each step:</p>
|
||||
|
||||
<ul>
|
||||
<li>Copy All: You can copy all the characters present on the screen (a partial copy is not allowed).</li>
|
||||
<li>Paste: You can paste the characters which are copied last time.</li>
|
||||
</ul>
|
||||
|
||||
<p>Given an integer <code>n</code>, return <em>the minimum number of operations to get the character</em> <code>'A'</code> <em>exactly</em> <code>n</code> <em>times on the screen</em>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> n = 3
|
||||
<strong>Output:</strong> 3
|
||||
<strong>Explanation:</strong> Intitally, we have one character 'A'.
|
||||
In step 1, we use Copy All operation.
|
||||
In step 2, we use Paste operation to get 'AA'.
|
||||
In step 3, we use Paste operation to get 'AAA'.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> n = 1
|
||||
<strong>Output:</strong> 0
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= n <= 1000</code></li>
|
||||
</ul>
|
174
算法题/2-keys-keyboard.json
Normal file
174
算法题/2-keys-keyboard.json
Normal file
File diff suppressed because one or more lines are too long
48
算法题/24-game.html
Normal file
48
算法题/24-game.html
Normal file
@ -0,0 +1,48 @@
|
||||
<p>You are given an integer array <code>cards</code> of length <code>4</code>. You have four cards, each containing a number in the range <code>[1, 9]</code>. You should arrange the numbers on these cards in a mathematical expression using the operators <code>['+', '-', '*', '/']</code> and the parentheses <code>'('</code> and <code>')'</code> to get the value 24.</p>
|
||||
|
||||
<p>You are restricted with the following rules:</p>
|
||||
|
||||
<ul>
|
||||
<li>The division operator <code>'/'</code> represents real division, not integer division.
|
||||
|
||||
<ul>
|
||||
<li>For example, <code>4 / (1 - 2 / 3) = 4 / (1 / 3) = 12</code>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>Every operation done is between two numbers. In particular, we cannot use <code>'-'</code> as a unary operator.
|
||||
<ul>
|
||||
<li>For example, if <code>cards = [1, 1, 1, 1]</code>, the expression <code>"-1 - 1 - 1 - 1"</code> is <strong>not allowed</strong>.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>You cannot concatenate numbers together
|
||||
<ul>
|
||||
<li>For example, if <code>cards = [1, 2, 1, 2]</code>, the expression <code>"12 + 12"</code> is not valid.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>Return <code>true</code> if you can get such expression that evaluates to <code>24</code>, and <code>false</code> otherwise.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> cards = [4,1,8,7]
|
||||
<strong>Output:</strong> true
|
||||
<strong>Explanation:</strong> (8-4) * (7-1) = 24
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> cards = [1,2,1,2]
|
||||
<strong>Output:</strong> false
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>cards.length == 4</code></li>
|
||||
<li><code>1 <= cards[i] <= 9</code></li>
|
||||
</ul>
|
171
算法题/24-game.json
Normal file
171
算法题/24-game.json
Normal file
File diff suppressed because one or more lines are too long
30
算法题/3sum-closest.html
Normal file
30
算法题/3sum-closest.html
Normal file
@ -0,0 +1,30 @@
|
||||
<p>Given an integer array <code>nums</code> of length <code>n</code> and an integer <code>target</code>, find three integers in <code>nums</code> such that the sum is closest to <code>target</code>.</p>
|
||||
|
||||
<p>Return <em>the sum of the three integers</em>.</p>
|
||||
|
||||
<p>You may assume that each input would have exactly one solution.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [-1,2,1,-4], target = 1
|
||||
<strong>Output:</strong> 2
|
||||
<strong>Explanation:</strong> The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [0,0,0], target = 1
|
||||
<strong>Output:</strong> 0
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>3 <= nums.length <= 1000</code></li>
|
||||
<li><code>-1000 <= nums[i] <= 1000</code></li>
|
||||
<li><code>-10<sup>4</sup> <= target <= 10<sup>4</sup></code></li>
|
||||
</ul>
|
178
算法题/3sum-closest.json
Normal file
178
算法题/3sum-closest.json
Normal file
File diff suppressed because one or more lines are too long
37
算法题/3sum-with-multiplicity.html
Normal file
37
算法题/3sum-with-multiplicity.html
Normal file
@ -0,0 +1,37 @@
|
||||
<p>Given an integer array <code>arr</code>, and an integer <code>target</code>, return the number of tuples <code>i, j, k</code> such that <code>i < j < k</code> and <code>arr[i] + arr[j] + arr[k] == target</code>.</p>
|
||||
|
||||
<p>As the answer can be very large, return it <strong>modulo</strong> <code>10<sup>9</sup> + 7</code>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> arr = [1,1,2,2,3,3,4,4,5,5], target = 8
|
||||
<strong>Output:</strong> 20
|
||||
<strong>Explanation: </strong>
|
||||
Enumerating by the values (arr[i], arr[j], arr[k]):
|
||||
(1, 2, 5) occurs 8 times;
|
||||
(1, 3, 4) occurs 8 times;
|
||||
(2, 2, 4) occurs 2 times;
|
||||
(2, 3, 3) occurs 2 times.
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> arr = [1,1,2,2,2,2], target = 5
|
||||
<strong>Output:</strong> 12
|
||||
<strong>Explanation: </strong>
|
||||
arr[i] = 1, arr[j] = arr[k] = 2 occurs 12 times:
|
||||
We choose one 1 from [1,1] in 2 ways,
|
||||
and two 2s from [2,2,2,2] in 6 ways.
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>3 <= arr.length <= 3000</code></li>
|
||||
<li><code>0 <= arr[i] <= 100</code></li>
|
||||
<li><code>0 <= target <= 300</code></li>
|
||||
</ul>
|
190
算法题/3sum-with-multiplicity.json
Normal file
190
算法题/3sum-with-multiplicity.json
Normal file
File diff suppressed because one or more lines are too long
22
算法题/3sum.html
Normal file
22
算法题/3sum.html
Normal file
@ -0,0 +1,22 @@
|
||||
<p>Given an integer array nums, return all the triplets <code>[nums[i], nums[j], nums[k]]</code> such that <code>i != j</code>, <code>i != k</code>, and <code>j != k</code>, and <code>nums[i] + nums[j] + nums[k] == 0</code>.</p>
|
||||
|
||||
<p>Notice that the solution set must not contain duplicate triplets.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<pre><strong>Input:</strong> nums = [-1,0,1,2,-1,-4]
|
||||
<strong>Output:</strong> [[-1,-1,2],[-1,0,1]]
|
||||
</pre><p><strong>Example 2:</strong></p>
|
||||
<pre><strong>Input:</strong> nums = []
|
||||
<strong>Output:</strong> []
|
||||
</pre><p><strong>Example 3:</strong></p>
|
||||
<pre><strong>Input:</strong> nums = [0]
|
||||
<strong>Output:</strong> []
|
||||
</pre>
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>0 <= nums.length <= 3000</code></li>
|
||||
<li><code>-10<sup>5</sup> <= nums[i] <= 10<sup>5</sup></code></li>
|
||||
</ul>
|
182
算法题/3sum.json
Normal file
182
算法题/3sum.json
Normal file
File diff suppressed because one or more lines are too long
37
算法题/4sum-ii.html
Normal file
37
算法题/4sum-ii.html
Normal file
@ -0,0 +1,37 @@
|
||||
<p>Given four integer arrays <code>nums1</code>, <code>nums2</code>, <code>nums3</code>, and <code>nums4</code> all of length <code>n</code>, return the number of tuples <code>(i, j, k, l)</code> such that:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>0 <= i, j, k, l < n</code></li>
|
||||
<li><code>nums1[i] + nums2[j] + nums3[k] + nums4[l] == 0</code></li>
|
||||
</ul>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums1 = [1,2], nums2 = [-2,-1], nums3 = [-1,2], nums4 = [0,2]
|
||||
<strong>Output:</strong> 2
|
||||
<strong>Explanation:</strong>
|
||||
The two tuples are:
|
||||
1. (0, 0, 0, 1) -> nums1[0] + nums2[0] + nums3[0] + nums4[1] = 1 + (-2) + (-1) + 2 = 0
|
||||
2. (1, 1, 0, 0) -> nums1[1] + nums2[1] + nums3[0] + nums4[0] = 2 + (-1) + (-1) + 0 = 0
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums1 = [0], nums2 = [0], nums3 = [0], nums4 = [0]
|
||||
<strong>Output:</strong> 1
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>n == nums1.length</code></li>
|
||||
<li><code>n == nums2.length</code></li>
|
||||
<li><code>n == nums3.length</code></li>
|
||||
<li><code>n == nums4.length</code></li>
|
||||
<li><code>1 <= n <= 200</code></li>
|
||||
<li><code>-2<sup>28</sup> <= nums1[i], nums2[i], nums3[i], nums4[i] <= 2<sup>28</sup></code></li>
|
||||
</ul>
|
179
算法题/4sum-ii.json
Normal file
179
算法题/4sum-ii.json
Normal file
File diff suppressed because one or more lines are too long
33
算法题/4sum.html
Normal file
33
算法题/4sum.html
Normal file
@ -0,0 +1,33 @@
|
||||
<p>Given an array <code>nums</code> of <code>n</code> integers, return <em>an array of all the <strong>unique</strong> quadruplets</em> <code>[nums[a], nums[b], nums[c], nums[d]]</code> such that:</p>
|
||||
|
||||
<ul>
|
||||
<li><code>0 <= a, b, c, d < n</code></li>
|
||||
<li><code>a</code>, <code>b</code>, <code>c</code>, and <code>d</code> are <strong>distinct</strong>.</li>
|
||||
<li><code>nums[a] + nums[b] + nums[c] + nums[d] == target</code></li>
|
||||
</ul>
|
||||
|
||||
<p>You may return the answer in <strong>any order</strong>.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [1,0,-1,0,-2,2], target = 0
|
||||
<strong>Output:</strong> [[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>Input:</strong> nums = [2,2,2,2,2], target = 8
|
||||
<strong>Output:</strong> [[2,2,2,2]]
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Constraints:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= nums.length <= 200</code></li>
|
||||
<li><code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code></li>
|
||||
<li><code>-10<sup>9</sup> <= target <= 10<sup>9</sup></code></li>
|
||||
</ul>
|
178
算法题/4sum.json
Normal file
178
算法题/4sum.json
Normal file
File diff suppressed because one or more lines are too long
51027
算法题/[en]json1-origin-data.json
Normal file
51027
算法题/[en]json1-origin-data.json
Normal file
File diff suppressed because it is too large
Load Diff
51016
算法题/[en]json2-problemset.json
Normal file
51016
算法题/[en]json2-problemset.json
Normal file
File diff suppressed because it is too large
Load Diff
75
算法题/[no content]3sum-smaller.json
Normal file
75
算法题/[no content]3sum-smaller.json
Normal file
File diff suppressed because one or more lines are too long
56
算法题/[no content]4-keys-keyboard.json
Normal file
56
算法题/[no content]4-keys-keyboard.json
Normal file
File diff suppressed because one or more lines are too long
60
算法题/[no content]active-businesses.json
Normal file
60
算法题/[no content]active-businesses.json
Normal file
@ -0,0 +1,60 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "1225",
|
||||
"questionFrontendId": "1126",
|
||||
"boundTopicId": null,
|
||||
"title": "Active Businesses",
|
||||
"titleSlug": "active-businesses",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 174,
|
||||
"dislikes": 20,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "{\"headers\":{\"Events\":[\"business_id\",\"event_type\",\"occurences\"]},\"rows\":{\"Events\":[[1,\"reviews\",7],[3,\"reviews\",3],[1,\"ads\",11],[2,\"ads\",7],[3,\"ads\",6],[1,\"page views\",3],[2,\"page views\",12]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"28.7K\", \"totalSubmission\": \"42.3K\", \"totalAcceptedRaw\": 28694, \"totalSubmissionRaw\": 42287, \"acRate\": \"67.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Events\":[\"business_id\",\"event_type\",\"occurences\"]},\"rows\":{\"Events\":[[1,\"reviews\",7],[3,\"reviews\",3],[1,\"ads\",11],[2,\"ads\",7],[3,\"ads\",6],[1,\"page views\",3],[2,\"page views\",12]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Events (business_id int, event_type varchar(10), occurences int)\"\n ],\n \"mssql\": [\n \"Create table Events (business_id int, event_type varchar(10), occurences int)\"\n ],\n \"oraclesql\": [\n \"Create table Events (business_id int, event_type varchar(10), occurences int)\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Events (business_id int, event_type varchar(10), occurences int)",
|
||||
"Truncate table Events",
|
||||
"insert into Events (business_id, event_type, occurences) values ('1', 'reviews', '7')",
|
||||
"insert into Events (business_id, event_type, occurences) values ('3', 'reviews', '3')",
|
||||
"insert into Events (business_id, event_type, occurences) values ('1', 'ads', '11')",
|
||||
"insert into Events (business_id, event_type, occurences) values ('2', 'ads', '7')",
|
||||
"insert into Events (business_id, event_type, occurences) values ('3', 'ads', '6')",
|
||||
"insert into Events (business_id, event_type, occurences) values ('1', 'page views', '3')",
|
||||
"insert into Events (business_id, event_type, occurences) values ('2', 'page views', '12')"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
74
算法题/[no content]add-bold-tag-in-string.json
Normal file
74
算法题/[no content]add-bold-tag-in-string.json
Normal file
File diff suppressed because one or more lines are too long
87
算法题/[no content]alien-dictionary.json
Normal file
87
算法题/[no content]alien-dictionary.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
67
算法题/[no content]analyze-user-website-visit-pattern.json
Normal file
67
算法题/[no content]analyze-user-website-visit-pattern.json
Normal file
File diff suppressed because one or more lines are too long
56
算法题/[no content]android-unlock-patterns.json
Normal file
56
算法题/[no content]android-unlock-patterns.json
Normal file
File diff suppressed because one or more lines are too long
61
算法题/[no content]armstrong-number.json
Normal file
61
算法题/[no content]armstrong-number.json
Normal file
File diff suppressed because one or more lines are too long
59
算法题/[no content]array-transformation.json
Normal file
59
算法题/[no content]array-transformation.json
Normal file
File diff suppressed because one or more lines are too long
61
算法题/[no content]article-views-ii.json
Normal file
61
算法题/[no content]article-views-ii.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "1259",
|
||||
"questionFrontendId": "1149",
|
||||
"boundTopicId": null,
|
||||
"title": "Article Views II",
|
||||
"titleSlug": "article-views-ii",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 80,
|
||||
"dislikes": 25,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "{\"headers\":{\"Views\":[\"article_id\",\"author_id\",\"viewer_id\",\"view_date\"]},\"rows\":{\"Views\":[[1,3,5,\"2019-08-01\"],[3,4,5,\"2019-08-01\"],[1,3,6,\"2019-08-02\"],[2,7,7,\"2019-08-01\"],[2,7,6,\"2019-08-02\"],[4,7,1,\"2019-07-22\"],[3,4,4,\"2019-07-21\"],[3,4,4,\"2019-07-21\"]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"23.7K\", \"totalSubmission\": \"49.6K\", \"totalAcceptedRaw\": 23744, \"totalSubmissionRaw\": 49600, \"acRate\": \"47.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Views\":[\"article_id\",\"author_id\",\"viewer_id\",\"view_date\"]},\"rows\":{\"Views\":[[1,3,5,\"2019-08-01\"],[3,4,5,\"2019-08-01\"],[1,3,6,\"2019-08-02\"],[2,7,7,\"2019-08-01\"],[2,7,6,\"2019-08-02\"],[4,7,1,\"2019-07-22\"],[3,4,4,\"2019-07-21\"],[3,4,4,\"2019-07-21\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Views (article_id int, author_id int, viewer_id int, view_date date)\"\n ],\n \"mssql\": [\n \"Create table Views (article_id int, author_id int, viewer_id int, view_date date)\"\n ],\n \"oraclesql\": [\n \"Create table Views (article_id int, author_id int, viewer_id int, view_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 Views (article_id int, author_id int, viewer_id int, view_date date)",
|
||||
"Truncate table Views",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('1', '3', '5', '2019-08-01')",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '5', '2019-08-01')",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('1', '3', '6', '2019-08-02')",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('2', '7', '7', '2019-08-01')",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('2', '7', '6', '2019-08-02')",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('4', '7', '1', '2019-07-22')",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '4', '2019-07-21')",
|
||||
"insert into Views (article_id, author_id, viewer_id, view_date) values ('3', '4', '4', '2019-07-21')"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
71
算法题/[no content]average-salary-departments-vs-company.json
Normal file
71
算法题/[no content]average-salary-departments-vs-company.json
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "615",
|
||||
"questionFrontendId": "615",
|
||||
"boundTopicId": null,
|
||||
"title": "Average Salary: Departments VS Company",
|
||||
"titleSlug": "average-salary-departments-vs-company",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Hard",
|
||||
"likes": 171,
|
||||
"dislikes": 58,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Countries You Can Safely Invest In\", \"titleSlug\": \"countries-you-can-safely-invest-in\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "{\"headers\":{\"Salary\":[\"id\",\"employee_id\",\"amount\",\"pay_date\"],\"Employee\":[\"employee_id\",\"department_id\"]},\"rows\":{\"Salary\":[[1,1,9000,\"2017/03/31\"],[2,2,6000,\"2017/03/31\"],[3,3,10000,\"2017/03/31\"],[4,1,7000,\"2017/02/28\"],[5,2,6000,\"2017/02/28\"],[6,3,8000,\"2017/02/28\"]],\"Employee\":[[1,1],[2,2],[3,2]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"25.2K\", \"totalSubmission\": \"44.9K\", \"totalAcceptedRaw\": 25183, \"totalSubmissionRaw\": 44907, \"acRate\": \"56.1%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "169",
|
||||
"canSeeDetail": true,
|
||||
"paidOnly": false,
|
||||
"hasVideoSolution": false,
|
||||
"paidOnlyVideo": true,
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Salary\":[\"id\",\"employee_id\",\"amount\",\"pay_date\"],\"Employee\":[\"employee_id\",\"department_id\"]},\"rows\":{\"Salary\":[[1,1,9000,\"2017/03/31\"],[2,2,6000,\"2017/03/31\"],[3,3,10000,\"2017/03/31\"],[4,1,7000,\"2017/02/28\"],[5,2,6000,\"2017/02/28\"],[6,3,8000,\"2017/02/28\"]],\"Employee\":[[1,1],[2,2],[3,2]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Salary (id int, employee_id int, amount int, pay_date date)\",\n \"Create table If Not Exists Employee (employee_id int, department_id int)\"\n ],\n \"mssql\": [\n \"Create table Salary (id int, employee_id int, amount int, pay_date date)\",\n \"Create table Employee (employee_id int, department_id int)\"\n ],\n \"oraclesql\": [\n \"Create table Salary (id int, employee_id int, amount int, pay_date date)\",\n \"Create table Employee (employee_id int, department_id 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 Salary (id int, employee_id int, amount int, pay_date date)",
|
||||
"Create table If Not Exists Employee (employee_id int, department_id int)",
|
||||
"Truncate table Salary",
|
||||
"insert into Salary (id, employee_id, amount, pay_date) values ('1', '1', '9000', '2017/03/31')",
|
||||
"insert into Salary (id, employee_id, amount, pay_date) values ('2', '2', '6000', '2017/03/31')",
|
||||
"insert into Salary (id, employee_id, amount, pay_date) values ('3', '3', '10000', '2017/03/31')",
|
||||
"insert into Salary (id, employee_id, amount, pay_date) values ('4', '1', '7000', '2017/02/28')",
|
||||
"insert into Salary (id, employee_id, amount, pay_date) values ('5', '2', '6000', '2017/02/28')",
|
||||
"insert into Salary (id, employee_id, amount, pay_date) values ('6', '3', '8000', '2017/02/28')",
|
||||
"Truncate table Employee",
|
||||
"insert into Employee (employee_id, department_id) values ('1', '1')",
|
||||
"insert into Employee (employee_id, department_id) values ('2', '2')",
|
||||
"insert into Employee (employee_id, department_id) values ('3', '2')"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
68
算法题/[no content]basic-calculator-iii.json
Normal file
68
算法题/[no content]basic-calculator-iii.json
Normal file
File diff suppressed because one or more lines are too long
71
算法题/[no content]before-and-after-puzzle.json
Normal file
71
算法题/[no content]before-and-after-puzzle.json
Normal file
File diff suppressed because one or more lines are too long
77
算法题/[no content]best-meeting-point.json
Normal file
77
算法题/[no content]best-meeting-point.json
Normal file
File diff suppressed because one or more lines are too long
68
算法题/[no content]biggest-single-number.json
Normal file
68
算法题/[no content]biggest-single-number.json
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "619",
|
||||
"questionFrontendId": "619",
|
||||
"boundTopicId": null,
|
||||
"title": "Biggest Single Number",
|
||||
"titleSlug": "biggest-single-number",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Easy",
|
||||
"likes": 116,
|
||||
"dislikes": 104,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "{\"headers\": {\"MyNumbers\": [\"num\"]}, \"rows\": {\"MyNumbers\": [[8],[8],[3],[3],[1],[4],[5],[6]]}}\n{\"headers\": {\"MyNumbers\": [\"num\"]}, \"rows\": {\"MyNumbers\": [[8],[8],[7],[7],[3],[3],[3]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"44.1K\", \"totalSubmission\": \"93.2K\", \"totalAcceptedRaw\": 44098, \"totalSubmissionRaw\": 93173, \"acRate\": \"47.3%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "188",
|
||||
"canSeeDetail": true,
|
||||
"paidOnly": false,
|
||||
"hasVideoSolution": false,
|
||||
"paidOnlyVideo": true,
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\": {\"MyNumbers\": [\"num\"]}, \"rows\": {\"MyNumbers\": [[8],[8],[3],[3],[1],[4],[5],[6]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists MyNumbers (num int)\"\n ],\n \"mssql\": [\n \"Create table MyNumbers (num int)\"\n ],\n \"oraclesql\": [\n \"Create table MyNumbers (num int)\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists MyNumbers (num int)",
|
||||
"Truncate table MyNumbers",
|
||||
"insert into MyNumbers (num) values ('8')",
|
||||
"insert into MyNumbers (num) values ('8')",
|
||||
"insert into MyNumbers (num) values ('3')",
|
||||
"insert into MyNumbers (num) values ('3')",
|
||||
"insert into MyNumbers (num) values ('1')",
|
||||
"insert into MyNumbers (num) values ('4')",
|
||||
"insert into MyNumbers (num) values ('5')",
|
||||
"insert into MyNumbers (num) values ('6')"
|
||||
],
|
||||
"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
File diff suppressed because one or more lines are too long
62
算法题/[no content]binary-tree-upside-down.json
Normal file
62
算法题/[no content]binary-tree-upside-down.json
Normal file
File diff suppressed because one or more lines are too long
81
算法题/[no content]binary-tree-vertical-order-traversal.json
Normal file
81
算法题/[no content]binary-tree-vertical-order-traversal.json
Normal file
File diff suppressed because one or more lines are too long
76
算法题/[no content]bold-words-in-string.json
Normal file
76
算法题/[no content]bold-words-in-string.json
Normal file
File diff suppressed because one or more lines are too long
69
算法题/[no content]bomb-enemy.json
Normal file
69
算法题/[no content]bomb-enemy.json
Normal file
File diff suppressed because one or more lines are too long
69
算法题/[no content]boundary-of-binary-tree.json
Normal file
69
算法题/[no content]boundary-of-binary-tree.json
Normal file
File diff suppressed because one or more lines are too long
72
算法题/[no content]brace-expansion.json
Normal file
72
算法题/[no content]brace-expansion.json
Normal file
File diff suppressed because one or more lines are too long
83
算法题/[no content]campus-bikes-ii.json
Normal file
83
算法题/[no content]campus-bikes-ii.json
Normal file
File diff suppressed because one or more lines are too long
79
算法题/[no content]campus-bikes.json
Normal file
79
算法题/[no content]campus-bikes.json
Normal file
File diff suppressed because one or more lines are too long
77
算法题/[no content]candy-crush.json
Normal file
77
算法题/[no content]candy-crush.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
98
算法题/[no content]closest-binary-search-tree-value-ii.json
Normal file
98
算法题/[no content]closest-binary-search-tree-value-ii.json
Normal file
File diff suppressed because one or more lines are too long
81
算法题/[no content]closest-binary-search-tree-value.json
Normal file
81
算法题/[no content]closest-binary-search-tree-value.json
Normal file
File diff suppressed because one or more lines are too long
77
算法题/[no content]closest-leaf-in-a-binary-tree.json
Normal file
77
算法题/[no content]closest-leaf-in-a-binary-tree.json
Normal file
File diff suppressed because one or more lines are too long
63
算法题/[no content]coin-path.json
Normal file
63
算法题/[no content]coin-path.json
Normal file
File diff suppressed because one or more lines are too long
59
算法题/[no content]confusing-number-ii.json
Normal file
59
算法题/[no content]confusing-number-ii.json
Normal file
File diff suppressed because one or more lines are too long
52
算法题/[no content]confusing-number.json
Normal file
52
算法题/[no content]confusing-number.json
Normal file
File diff suppressed because one or more lines are too long
82
算法题/[no content]connecting-cities-with-minimum-cost.json
Normal file
82
算法题/[no content]connecting-cities-with-minimum-cost.json
Normal file
File diff suppressed because one or more lines are too long
65
算法题/[no content]consecutive-available-seats.json
Normal file
65
算法题/[no content]consecutive-available-seats.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "603",
|
||||
"questionFrontendId": "603",
|
||||
"boundTopicId": null,
|
||||
"title": "Consecutive Available Seats",
|
||||
"titleSlug": "consecutive-available-seats",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Easy",
|
||||
"likes": 449,
|
||||
"dislikes": 40,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "{\"headers\":{\"Cinema\":[\"seat_id\",\"free\"]},\"rows\":{\"Cinema\":[[1,1],[2,0],[3,1],[4,1],[5,1]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"53.2K\", \"totalSubmission\": \"78.5K\", \"totalAcceptedRaw\": 53210, \"totalSubmissionRaw\": 78491, \"acRate\": \"67.8%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "168",
|
||||
"canSeeDetail": true,
|
||||
"paidOnly": false,
|
||||
"hasVideoSolution": false,
|
||||
"paidOnlyVideo": true,
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Cinema\":[\"seat_id\",\"free\"]},\"rows\":{\"Cinema\":[[1,1],[2,0],[3,1],[4,1],[5,1]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Cinema (seat_id int primary key auto_increment, free bool)\"\n ],\n \"mssql\": [\n \"Create table Cinema (seat_id int primary key, free BIT)\"\n ],\n \"oraclesql\": [\n \"Create table Cinema (seat_id int primary key, free NUMBER(1))\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Cinema (seat_id int primary key auto_increment, free bool)",
|
||||
"Truncate table Cinema",
|
||||
"insert into Cinema (seat_id, free) values ('1', '1')",
|
||||
"insert into Cinema (seat_id, free) values ('2', '0')",
|
||||
"insert into Cinema (seat_id, free) values ('3', '1')",
|
||||
"insert into Cinema (seat_id, free) values ('4', '1')",
|
||||
"insert into Cinema (seat_id, free) values ('5', '1')"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
75
算法题/[no content]construct-binary-tree-from-string.json
Normal file
75
算法题/[no content]construct-binary-tree-from-string.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
56
算法题/[no content]convex-polygon.json
Normal file
56
算法题/[no content]convex-polygon.json
Normal file
File diff suppressed because one or more lines are too long
71
算法题/[no content]count-student-number-in-departments.json
Normal file
71
算法题/[no content]count-student-number-in-departments.json
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "580",
|
||||
"questionFrontendId": "580",
|
||||
"boundTopicId": null,
|
||||
"title": "Count Student Number in Departments",
|
||||
"titleSlug": "count-student-number-in-departments",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 180,
|
||||
"dislikes": 30,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "{\"headers\":{\"Student\":[\"student_id\",\"student_name\",\"gender\",\"dept_id\"],\"Department\":[\"dept_id\",\"dept_name\"]},\"rows\":{\"Student\":[[1,\"Jack\",\"M\",1],[2,\"Jane\",\"F\",1],[3,\"Mark\",\"M\",2]],\"Department\":[[1,\"Engineering\"],[2,\"Science\"],[3,\"Law\"]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"42.8K\", \"totalSubmission\": \"76.1K\", \"totalAcceptedRaw\": 42828, \"totalSubmissionRaw\": 76062, \"acRate\": \"56.3%\"}",
|
||||
"hints": [
|
||||
"Still remember the difference between 'INNER JOIN' and 'OUTTER JOIN' in SQL?",
|
||||
"Do you know other expressions using the 'COUNT' function besides 'COUNT(*)'?"
|
||||
],
|
||||
"solution": {
|
||||
"id": "159",
|
||||
"canSeeDetail": true,
|
||||
"paidOnly": false,
|
||||
"hasVideoSolution": false,
|
||||
"paidOnlyVideo": true,
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Student\":[\"student_id\",\"student_name\",\"gender\",\"dept_id\"],\"Department\":[\"dept_id\",\"dept_name\"]},\"rows\":{\"Student\":[[1,\"Jack\",\"M\",1],[2,\"Jane\",\"F\",1],[3,\"Mark\",\"M\",2]],\"Department\":[[1,\"Engineering\"],[2,\"Science\"],[3,\"Law\"]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Student (student_id int,student_name varchar(45), gender varchar(6), dept_id int)\",\n \"Create table If Not Exists Department (dept_id int, dept_name varchar(255))\"\n ],\n \"mssql\": [\n \"Create table Student (student_id int,student_name varchar(45), gender varchar(6), dept_id int)\",\n \"Create table Department (dept_id int, dept_name varchar(255))\"\n ],\n \"oraclesql\": [\n \"Create table Student (student_id int,student_name varchar(45), gender varchar(6), dept_id int)\",\n \"Create table Department (dept_id int, dept_name varchar(255))\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Student (student_id int,student_name varchar(45), gender varchar(6), dept_id int)",
|
||||
"Create table If Not Exists Department (dept_id int, dept_name varchar(255))",
|
||||
"Truncate table Student",
|
||||
"insert into Student (student_id, student_name, gender, dept_id) values ('1', 'Jack', 'M', '1')",
|
||||
"insert into Student (student_id, student_name, gender, dept_id) values ('2', 'Jane', 'F', '1')",
|
||||
"insert into Student (student_id, student_name, gender, dept_id) values ('3', 'Mark', 'M', '2')",
|
||||
"Truncate table Department",
|
||||
"insert into Department (dept_id, dept_name) values ('1', 'Engineering')",
|
||||
"insert into Department (dept_id, dept_name) values ('2', 'Science')",
|
||||
"insert into Department (dept_id, dept_name) values ('3', 'Law')"
|
||||
],
|
||||
"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
File diff suppressed because one or more lines are too long
69
算法题/[no content]count-univalue-subtrees.json
Normal file
69
算法题/[no content]count-univalue-subtrees.json
Normal file
File diff suppressed because one or more lines are too long
62
算法题/[no content]customers-who-bought-all-products.json
Normal file
62
算法题/[no content]customers-who-bought-all-products.json
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "1135",
|
||||
"questionFrontendId": "1045",
|
||||
"boundTopicId": null,
|
||||
"title": "Customers Who Bought All Products",
|
||||
"titleSlug": "customers-who-bought-all-products",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 171,
|
||||
"dislikes": 35,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "{\"headers\":{\"Customer\":[\"customer_id\",\"product_key\"],\"Product\":[\"product_key\"]},\"rows\":{\"Customer\":[[1,5],[2,6],[3,5],[3,6],[1,6]],\"Product\":[[5],[6]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"34.9K\", \"totalSubmission\": \"51.8K\", \"totalAcceptedRaw\": 34877, \"totalSubmissionRaw\": 51822, \"acRate\": \"67.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Customer\":[\"customer_id\",\"product_key\"],\"Product\":[\"product_key\"]},\"rows\":{\"Customer\":[[1,5],[2,6],[3,5],[3,6],[1,6]],\"Product\":[[5],[6]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Customer (customer_id int, product_key int)\",\n \"Create table Product (product_key int)\"\n ],\n \"mssql\": [\n \"Create table Customer (customer_id int, product_key int)\",\n \"Create table Product (product_key int)\"\n ],\n \"oraclesql\": [\n \"Create table Customer (customer_id int, product_key int)\",\n \"Create table Product (product_key int)\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Customer (customer_id int, product_key int)",
|
||||
"Create table Product (product_key int)",
|
||||
"Truncate table Customer",
|
||||
"insert into Customer (customer_id, product_key) values ('1', '5')",
|
||||
"insert into Customer (customer_id, product_key) values ('2', '6')",
|
||||
"insert into Customer (customer_id, product_key) values ('3', '5')",
|
||||
"insert into Customer (customer_id, product_key) values ('3', '6')",
|
||||
"insert into Customer (customer_id, product_key) values ('1', '6')",
|
||||
"Truncate table Product",
|
||||
"insert into Product (product_key) values ('5')",
|
||||
"insert into Product (product_key) values ('6')"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
66
算法题/[no content]delete-tree-nodes.json
Normal file
66
算法题/[no content]delete-tree-nodes.json
Normal file
File diff suppressed because one or more lines are too long
73
算法题/[no content]design-a-leaderboard.json
Normal file
73
算法题/[no content]design-a-leaderboard.json
Normal file
File diff suppressed because one or more lines are too long
50
算法题/[no content]design-bounded-blocking-queue.json
Normal file
50
算法题/[no content]design-bounded-blocking-queue.json
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "1209",
|
||||
"questionFrontendId": "1188",
|
||||
"boundTopicId": null,
|
||||
"title": "Design Bounded Blocking Queue",
|
||||
"titleSlug": "design-bounded-blocking-queue",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Medium",
|
||||
"likes": 403,
|
||||
"dislikes": 31,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
"exampleTestcases": "1\n1\n[\"BoundedBlockingQueue\",\"enqueue\",\"dequeue\",\"dequeue\",\"enqueue\",\"enqueue\",\"enqueue\",\"enqueue\",\"dequeue\"]\n[[2],[1],[],[],[0],[2],[3],[4],[]]\n3\n4\n[\"BoundedBlockingQueue\",\"enqueue\",\"enqueue\",\"enqueue\",\"dequeue\",\"dequeue\",\"dequeue\",\"enqueue\"]\n[[3],[1],[0],[2],[],[],[],[3]]",
|
||||
"categoryTitle": "Concurrency",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Concurrency",
|
||||
"slug": "concurrency",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"35.1K\", \"totalSubmission\": \"48K\", \"totalAcceptedRaw\": 35076, \"totalSubmissionRaw\": 48037, \"acRate\": \"73.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "1\n1\n[\"BoundedBlockingQueue\",\"enqueue\",\"dequeue\",\"dequeue\",\"enqueue\",\"enqueue\",\"enqueue\",\"enqueue\",\"dequeue\"]\n[[2],[1],[],[],[0],[2],[3],[4],[]]",
|
||||
"metaData": "{\n \"name\": \"foobar\",\n \"params\": [\n {\n \"name\": \"numsProducerThread\",\n \"type\": \"integer\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"numsConsumerThread\"\n },\n {\n \"type\": \"string[]\",\n \"name\": \"methods\"\n },\n {\n \"type\": \"integer[]\",\n \"name\": \"params\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"cpp\",\n \"java\",\n \"python\",\n \"python3\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"enableTestMode": false,
|
||||
"enableDebugger": false,
|
||||
"envInfo": "{\"cpp\": [\"C++\", \"<p>Compiled with <code> clang 11 </code> using the latest C++ 17 standard.</p>\\r\\n\\r\\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\\\"https://github.com/google/sanitizers/wiki/AddressSanitizer\\\" target=\\\"_blank\\\">AddressSanitizer</a> is also enabled to help detect out-of-bounds and use-after-free bugs.</p>\\r\\n\\r\\n<p>Most standard library headers are already included automatically for your convenience.</p>\"], \"java\": [\"Java\", \"<p><code> OpenJDK 17 </code>. Java 8 features such as lambda expressions and stream API can be used. </p>\\r\\n\\r\\n<p>Most standard library headers are already included automatically for your convenience.</p>\\r\\n<p>Includes <code>Pair</code> class from https://docs.oracle.com/javase/8/javafx/api/javafx/util/Pair.html.</p>\"], \"python\": [\"Python\", \"<p><code>Python 2.7.12</code>.</p>\\r\\n\\r\\n<p>Most libraries are already imported automatically for your convenience, such as <a href=\\\"https://docs.python.org/2/library/array.html\\\" target=\\\"_blank\\\">array</a>, <a href=\\\"https://docs.python.org/2/library/bisect.html\\\" target=\\\"_blank\\\">bisect</a>, <a href=\\\"https://docs.python.org/2/library/collections.html\\\" target=\\\"_blank\\\">collections</a>. If you need more libraries, you can import it yourself.</p>\\r\\n\\r\\n<p>For Map/TreeMap data structure, you may use <a href=\\\"http://www.grantjenks.com/docs/sortedcontainers/\\\" target=\\\"_blank\\\">sortedcontainers</a> library.</p>\\r\\n\\r\\n<p>Note that Python 2.7 <a href=\\\"https://www.python.org/dev/peps/pep-0373/\\\" target=\\\"_blank\\\">will not be maintained past 2020</a>. For the latest Python, please choose Python3 instead.</p>\"], \"python3\": [\"Python3\", \"<p><code>Python 3.10</code>.</p>\\r\\n\\r\\n<p>Most libraries are already imported automatically for your convenience, such as <a href=\\\"https://docs.python.org/3/library/array.html\\\" target=\\\"_blank\\\">array</a>, <a href=\\\"https://docs.python.org/3/library/bisect.html\\\" target=\\\"_blank\\\">bisect</a>, <a href=\\\"https://docs.python.org/3/library/collections.html\\\" target=\\\"_blank\\\">collections</a>. If you need more libraries, you can import it yourself.</p>\\r\\n\\r\\n<p>For Map/TreeMap data structure, you may use <a href=\\\"http://www.grantjenks.com/docs/sortedcontainers/\\\" target=\\\"_blank\\\">sortedcontainers</a> library.</p>\"]}",
|
||||
"libraryUrl": null,
|
||||
"adminUrl": null,
|
||||
"challengeQuestion": null,
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
81
算法题/[no content]design-compressed-string-iterator.json
Normal file
81
算法题/[no content]design-compressed-string-iterator.json
Normal file
File diff suppressed because one or more lines are too long
69
算法题/[no content]design-excel-sum-formula.json
Normal file
69
算法题/[no content]design-excel-sum-formula.json
Normal file
File diff suppressed because one or more lines are too long
79
算法题/[no content]design-file-system.json
Normal file
79
算法题/[no content]design-file-system.json
Normal file
File diff suppressed because one or more lines are too long
81
算法题/[no content]design-hit-counter.json
Normal file
81
算法题/[no content]design-hit-counter.json
Normal file
File diff suppressed because one or more lines are too long
82
算法题/[no content]design-in-memory-file-system.json
Normal file
82
算法题/[no content]design-in-memory-file-system.json
Normal file
File diff suppressed because one or more lines are too long
75
算法题/[no content]design-log-storage-system.json
Normal file
75
算法题/[no content]design-log-storage-system.json
Normal file
File diff suppressed because one or more lines are too long
74
算法题/[no content]design-phone-directory.json
Normal file
74
算法题/[no content]design-phone-directory.json
Normal file
File diff suppressed because one or more lines are too long
68
算法题/[no content]design-search-autocomplete-system.json
Normal file
68
算法题/[no content]design-search-autocomplete-system.json
Normal file
File diff suppressed because one or more lines are too long
75
算法题/[no content]design-snake-game.json
Normal file
75
算法题/[no content]design-snake-game.json
Normal file
File diff suppressed because one or more lines are too long
78
算法题/[no content]design-tic-tac-toe.json
Normal file
78
算法题/[no content]design-tic-tac-toe.json
Normal file
File diff suppressed because one or more lines are too long
58
算法题/[no content]diet-plan-performance.json
Normal file
58
算法题/[no content]diet-plan-performance.json
Normal file
File diff suppressed because one or more lines are too long
59
算法题/[no content]digit-count-in-range.json
Normal file
59
算法题/[no content]digit-count-in-range.json
Normal file
File diff suppressed because one or more lines are too long
62
算法题/[no content]divide-array-into-increasing-sequences.json
Normal file
62
算法题/[no content]divide-array-into-increasing-sequences.json
Normal file
File diff suppressed because one or more lines are too long
67
算法题/[no content]divide-chocolate.json
Normal file
67
算法题/[no content]divide-chocolate.json
Normal file
File diff suppressed because one or more lines are too long
71
算法题/[no content]employee-bonus.json
Normal file
71
算法题/[no content]employee-bonus.json
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "577",
|
||||
"questionFrontendId": "577",
|
||||
"boundTopicId": null,
|
||||
"title": "Employee Bonus",
|
||||
"titleSlug": "employee-bonus",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Easy",
|
||||
"likes": 157,
|
||||
"dislikes": 88,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Combine Two Tables\", \"titleSlug\": \"combine-two-tables\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "{\"headers\":{\"Employee\":[\"empId\",\"name\",\"supervisor\",\"salary\"],\"Bonus\":[\"empId\",\"bonus\"]},\"rows\":{\"Employee\":[[3,\"Brad\",null,4000],[1,\"John\",3,1000],[2,\"Dan\",3,2000],[4,\"Thomas\",3,4000]],\"Bonus\":[[2,500],[4,2000]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"56.9K\", \"totalSubmission\": \"76.2K\", \"totalAcceptedRaw\": 56945, \"totalSubmissionRaw\": 76187, \"acRate\": \"74.7%\"}",
|
||||
"hints": [
|
||||
"If the EmpId in table Employee has no match in table Bonus, we consider that the corresponding bonus is null and null is smaller than 1000.",
|
||||
"Inner join is the default join, we can solve the mismatching problem by using outer join."
|
||||
],
|
||||
"solution": {
|
||||
"id": "182",
|
||||
"canSeeDetail": true,
|
||||
"paidOnly": false,
|
||||
"hasVideoSolution": false,
|
||||
"paidOnlyVideo": true,
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\":{\"Employee\":[\"empId\",\"name\",\"supervisor\",\"salary\"],\"Bonus\":[\"empId\",\"bonus\"]},\"rows\":{\"Employee\":[[3,\"Brad\",null,4000],[1,\"John\",3,1000],[2,\"Dan\",3,2000],[4,\"Thomas\",3,4000]],\"Bonus\":[[2,500],[4,2000]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Employee (empId int, name varchar(255), supervisor int, salary int)\",\n \"Create table If Not Exists Bonus (empId int, bonus int)\"\n ],\n \"mssql\": [\n \"Create table Employee (empId int, name varchar(255), supervisor int, salary int)\",\n \"Create table Bonus (empId int, bonus int)\"\n ],\n \"oraclesql\": [\n \"Create table Employee (empId int, name varchar(255), supervisor int, salary int)\",\n \"Create table Bonus (empId int, bonus int)\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Employee (empId int, name varchar(255), supervisor int, salary int)",
|
||||
"Create table If Not Exists Bonus (empId int, bonus int)",
|
||||
"Truncate table Employee",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('3', 'Brad', 'None', '4000')",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('1', 'John', '3', '1000')",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('2', 'Dan', '3', '2000')",
|
||||
"insert into Employee (empId, name, supervisor, salary) values ('4', 'Thomas', '3', '4000')",
|
||||
"Truncate table Bonus",
|
||||
"insert into Bonus (empId, bonus) values ('2', '500')",
|
||||
"insert into Bonus (empId, bonus) values ('4', '2000')"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
64
算法题/[no content]employee-free-time.json
Normal file
64
算法题/[no content]employee-free-time.json
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "761",
|
||||
"questionFrontendId": "759",
|
||||
"boundTopicId": null,
|
||||
"title": "Employee Free Time",
|
||||
"titleSlug": "employee-free-time",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Hard",
|
||||
"likes": 1343,
|
||||
"dislikes": 85,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Merge Intervals\", \"titleSlug\": \"merge-intervals\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Interval List Intersections\", \"titleSlug\": \"interval-list-intersections\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "[[[1,2],[5,6]],[[1,3]],[[4,10]]]\n[[[1,3],[6,7]],[[2,4]],[[2,5],[9,12]]]",
|
||||
"categoryTitle": "Algorithms",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Array",
|
||||
"slug": "array",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Sorting",
|
||||
"slug": "sorting",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Heap (Priority Queue)",
|
||||
"slug": "heap-priority-queue",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"103.5K\", \"totalSubmission\": \"145.8K\", \"totalAcceptedRaw\": 103463, \"totalSubmissionRaw\": 145849, \"acRate\": \"70.9%\"}",
|
||||
"hints": [
|
||||
"Take all the intervals and do an \"events\" (or \"line sweep\") approach - an event of (x, OPEN) increases the number of active intervals, while (x, CLOSE) decreases it.\r\n\r\nProcessing in sorted order from left to right, if the number of active intervals is zero, then you crossed a region of common free time."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "[[[1,2],[5,6]],[[1,3]],[[4,10]]]",
|
||||
"metaData": "{\n \"name\": \"employeeFreeTime\",\n \"params\": [\n {\n \"name\": \"schedule\",\n \"type\": \"integer\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"cpp\",\n \"java\",\n \"python\",\n \"csharp\",\n \"javascript\",\n \"python3\",\n \"golang\",\n \"ruby\",\n \"kotlin\",\n \"scala\",\n \"swift\",\n \"php\",\n \"typescript\",\n \"rust\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"enableTestMode": false,
|
||||
"enableDebugger": true,
|
||||
"envInfo": "{\"cpp\": [\"C++\", \"<p>Compiled with <code> clang 11 </code> using the latest C++ 17 standard.</p>\\r\\n\\r\\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\\\"https://github.com/google/sanitizers/wiki/AddressSanitizer\\\" target=\\\"_blank\\\">AddressSanitizer</a> is also enabled to help detect out-of-bounds and use-after-free bugs.</p>\\r\\n\\r\\n<p>Most standard library headers are already included automatically for your convenience.</p>\"], \"java\": [\"Java\", \"<p><code> OpenJDK 17 </code>. Java 8 features such as lambda expressions and stream API can be used. </p>\\r\\n\\r\\n<p>Most standard library headers are already included automatically for your convenience.</p>\\r\\n<p>Includes <code>Pair</code> class from https://docs.oracle.com/javase/8/javafx/api/javafx/util/Pair.html.</p>\"], \"python\": [\"Python\", \"<p><code>Python 2.7.12</code>.</p>\\r\\n\\r\\n<p>Most libraries are already imported automatically for your convenience, such as <a href=\\\"https://docs.python.org/2/library/array.html\\\" target=\\\"_blank\\\">array</a>, <a href=\\\"https://docs.python.org/2/library/bisect.html\\\" target=\\\"_blank\\\">bisect</a>, <a href=\\\"https://docs.python.org/2/library/collections.html\\\" target=\\\"_blank\\\">collections</a>. If you need more libraries, you can import it yourself.</p>\\r\\n\\r\\n<p>For Map/TreeMap data structure, you may use <a href=\\\"http://www.grantjenks.com/docs/sortedcontainers/\\\" target=\\\"_blank\\\">sortedcontainers</a> library.</p>\\r\\n\\r\\n<p>Note that Python 2.7 <a href=\\\"https://www.python.org/dev/peps/pep-0373/\\\" target=\\\"_blank\\\">will not be maintained past 2020</a>. For the latest Python, please choose Python3 instead.</p>\"], \"csharp\": [\"C#\", \"<p><a href=\\\"https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9\\\" target=\\\"_blank\\\">C# 10 with .NET 6 runtime</a></p>\\r\\n\\r\\n<p>Your code is compiled with debug flag enabled (<code>/debug</code>).</p>\"], \"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 <a href=\\\"https://github.com/datastructures-js/priority-queue\\\" target=\\\"_blank\\\">datastructures-js/priority-queue</a> and <a href=\\\"https://github.com/datastructures-js/queue\\\" target=\\\"_blank\\\">datastructures-js/queue</a>.</p>\"], \"ruby\": [\"Ruby\", \"<p><code>Ruby 3.1</code></p>\\r\\n\\r\\n<p>Some common data structure implementations are provided in the Algorithms module: https://www.rubydoc.info/github/kanwei/algorithms/Algorithms</p>\"], \"swift\": [\"Swift\", \"<p><code>Swift 5.5.2</code>.</p>\"], \"golang\": [\"Go\", \"<p><code>Go 1.17.6</code>.</p>\\r\\n\\r\\n<p>Support <a href=\\\"https://godoc.org/github.com/emirpasic/gods\\\" target=\\\"_blank\\\">https://godoc.org/github.com/emirpasic/gods</a> library.</p>\"], \"python3\": [\"Python3\", \"<p><code>Python 3.10</code>.</p>\\r\\n\\r\\n<p>Most libraries are already imported automatically for your convenience, such as <a href=\\\"https://docs.python.org/3/library/array.html\\\" target=\\\"_blank\\\">array</a>, <a href=\\\"https://docs.python.org/3/library/bisect.html\\\" target=\\\"_blank\\\">bisect</a>, <a href=\\\"https://docs.python.org/3/library/collections.html\\\" target=\\\"_blank\\\">collections</a>. If you need more libraries, you can import it yourself.</p>\\r\\n\\r\\n<p>For Map/TreeMap data structure, you may use <a href=\\\"http://www.grantjenks.com/docs/sortedcontainers/\\\" target=\\\"_blank\\\">sortedcontainers</a> library.</p>\"], \"scala\": [\"Scala\", \"<p><code>Scala 2.13.7</code>.</p>\"], \"kotlin\": [\"Kotlin\", \"<p><code>Kotlin 1.3.10</code>.</p>\"], \"rust\": [\"Rust\", \"<p><code>Rust 1.58.1</code></p>\\r\\n\\r\\n<p>Supports <a href=\\\"https://crates.io/crates/rand\\\" target=\\\"_blank\\\">rand </a> v0.6\\u00a0from crates.io</p>\"], \"php\": [\"PHP\", \"<p><code>PHP 8.1</code>.</p>\\r\\n<p>With bcmath module</p>\"], \"typescript\": [\"Typescript\", \"<p><code>TypeScript 4.5.4, 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 ES2020 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"
|
||||
}
|
||||
}
|
||||
}
|
69
算法题/[no content]encode-and-decode-strings.json
Normal file
69
算法题/[no content]encode-and-decode-strings.json
Normal file
File diff suppressed because one or more lines are too long
81
算法题/[no content]encode-n-ary-tree-to-binary-tree.json
Normal file
81
算法题/[no content]encode-n-ary-tree-to-binary-tree.json
Normal file
@ -0,0 +1,81 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "771",
|
||||
"questionFrontendId": "431",
|
||||
"boundTopicId": null,
|
||||
"title": "Encode N-ary Tree to Binary Tree",
|
||||
"titleSlug": "encode-n-ary-tree-to-binary-tree",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Hard",
|
||||
"likes": 382,
|
||||
"dislikes": 21,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Serialize and Deserialize N-ary Tree\", \"titleSlug\": \"serialize-and-deserialize-n-ary-tree\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "[1,null,3,2,4,null,5,6]\n[1,null,2,3,4,5,null,null,6,7,null,8,null,9,10,null,null,11,null,12,null,13,null,null,14]\n[]",
|
||||
"categoryTitle": "Algorithms",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Tree",
|
||||
"slug": "tree",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Depth-First Search",
|
||||
"slug": "depth-first-search",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Breadth-First Search",
|
||||
"slug": "breadth-first-search",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Design",
|
||||
"slug": "design",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Binary Tree",
|
||||
"slug": "binary-tree",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"14.7K\", \"totalSubmission\": \"19.3K\", \"totalAcceptedRaw\": 14741, \"totalSubmissionRaw\": 19342, \"acRate\": \"76.2%\"}",
|
||||
"hints": [],
|
||||
"solution": {
|
||||
"id": "839",
|
||||
"canSeeDetail": false,
|
||||
"paidOnly": true,
|
||||
"hasVideoSolution": false,
|
||||
"paidOnlyVideo": true,
|
||||
"__typename": "ArticleNode"
|
||||
},
|
||||
"status": null,
|
||||
"sampleTestCase": "[1,null,3,2,4,null,5,6]",
|
||||
"metaData": "{\n \"name\": \"CodecDriver\",\n \"params\": [\n {\n \"name\": \"root\",\n \"type\": \"TreeNode\"\n }\n ],\n \"return\": {\n \"type\": \"TreeNode\"\n },\n \"languages\": [\n \"cpp\",\n \"java\",\n \"python\",\n \"csharp\",\n \"python3\",\n \"javascript\",\n \"golang\",\n \"kotlin\",\n \"ruby\",\n \"scala\",\n \"php\",\n \"swift\",\n \"typescript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"enableTestMode": false,
|
||||
"enableDebugger": true,
|
||||
"envInfo": "{\"cpp\": [\"C++\", \"<p>Compiled with <code> clang 11 </code> using the latest C++ 17 standard.</p>\\r\\n\\r\\n<p>Your code is compiled with level two optimization (<code>-O2</code>). <a href=\\\"https://github.com/google/sanitizers/wiki/AddressSanitizer\\\" target=\\\"_blank\\\">AddressSanitizer</a> is also enabled to help detect out-of-bounds and use-after-free bugs.</p>\\r\\n\\r\\n<p>Most standard library headers are already included automatically for your convenience.</p>\"], \"java\": [\"Java\", \"<p><code> OpenJDK 17 </code>. Java 8 features such as lambda expressions and stream API can be used. </p>\\r\\n\\r\\n<p>Most standard library headers are already included automatically for your convenience.</p>\\r\\n<p>Includes <code>Pair</code> class from https://docs.oracle.com/javase/8/javafx/api/javafx/util/Pair.html.</p>\"], \"python\": [\"Python\", \"<p><code>Python 2.7.12</code>.</p>\\r\\n\\r\\n<p>Most libraries are already imported automatically for your convenience, such as <a href=\\\"https://docs.python.org/2/library/array.html\\\" target=\\\"_blank\\\">array</a>, <a href=\\\"https://docs.python.org/2/library/bisect.html\\\" target=\\\"_blank\\\">bisect</a>, <a href=\\\"https://docs.python.org/2/library/collections.html\\\" target=\\\"_blank\\\">collections</a>. If you need more libraries, you can import it yourself.</p>\\r\\n\\r\\n<p>For Map/TreeMap data structure, you may use <a href=\\\"http://www.grantjenks.com/docs/sortedcontainers/\\\" target=\\\"_blank\\\">sortedcontainers</a> library.</p>\\r\\n\\r\\n<p>Note that Python 2.7 <a href=\\\"https://www.python.org/dev/peps/pep-0373/\\\" target=\\\"_blank\\\">will not be maintained past 2020</a>. For the latest Python, please choose Python3 instead.</p>\"], \"csharp\": [\"C#\", \"<p><a href=\\\"https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9\\\" target=\\\"_blank\\\">C# 10 with .NET 6 runtime</a></p>\\r\\n\\r\\n<p>Your code is compiled with debug flag enabled (<code>/debug</code>).</p>\"], \"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 <a href=\\\"https://github.com/datastructures-js/priority-queue\\\" target=\\\"_blank\\\">datastructures-js/priority-queue</a> and <a href=\\\"https://github.com/datastructures-js/queue\\\" target=\\\"_blank\\\">datastructures-js/queue</a>.</p>\"], \"ruby\": [\"Ruby\", \"<p><code>Ruby 3.1</code></p>\\r\\n\\r\\n<p>Some common data structure implementations are provided in the Algorithms module: https://www.rubydoc.info/github/kanwei/algorithms/Algorithms</p>\"], \"swift\": [\"Swift\", \"<p><code>Swift 5.5.2</code>.</p>\"], \"golang\": [\"Go\", \"<p><code>Go 1.17.6</code>.</p>\\r\\n\\r\\n<p>Support <a href=\\\"https://godoc.org/github.com/emirpasic/gods\\\" target=\\\"_blank\\\">https://godoc.org/github.com/emirpasic/gods</a> library.</p>\"], \"python3\": [\"Python3\", \"<p><code>Python 3.10</code>.</p>\\r\\n\\r\\n<p>Most libraries are already imported automatically for your convenience, such as <a href=\\\"https://docs.python.org/3/library/array.html\\\" target=\\\"_blank\\\">array</a>, <a href=\\\"https://docs.python.org/3/library/bisect.html\\\" target=\\\"_blank\\\">bisect</a>, <a href=\\\"https://docs.python.org/3/library/collections.html\\\" target=\\\"_blank\\\">collections</a>. If you need more libraries, you can import it yourself.</p>\\r\\n\\r\\n<p>For Map/TreeMap data structure, you may use <a href=\\\"http://www.grantjenks.com/docs/sortedcontainers/\\\" target=\\\"_blank\\\">sortedcontainers</a> library.</p>\"], \"scala\": [\"Scala\", \"<p><code>Scala 2.13.7</code>.</p>\"], \"kotlin\": [\"Kotlin\", \"<p><code>Kotlin 1.3.10</code>.</p>\"], \"php\": [\"PHP\", \"<p><code>PHP 8.1</code>.</p>\\r\\n<p>With bcmath module</p>\"], \"typescript\": [\"Typescript\", \"<p><code>TypeScript 4.5.4, 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 ES2020 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"
|
||||
}
|
||||
}
|
||||
}
|
65
算法题/[no content]encode-number.json
Normal file
65
算法题/[no content]encode-number.json
Normal file
File diff suppressed because one or more lines are too long
56
算法题/[no content]encode-string-with-shortest-length.json
Normal file
56
算法题/[no content]encode-string-with-shortest-length.json
Normal file
File diff suppressed because one or more lines are too long
69
算法题/[no content]equal-tree-partition.json
Normal file
69
算法题/[no content]equal-tree-partition.json
Normal file
File diff suppressed because one or more lines are too long
56
算法题/[no content]factor-combinations.json
Normal file
56
算法题/[no content]factor-combinations.json
Normal file
File diff suppressed because one or more lines are too long
65
算法题/[no content]find-anagram-mappings.json
Normal file
65
算法题/[no content]find-anagram-mappings.json
Normal file
File diff suppressed because one or more lines are too long
75
算法题/[no content]find-cumulative-salary-of-an-employee.json
Normal file
75
算法题/[no content]find-cumulative-salary-of-an-employee.json
Normal file
@ -0,0 +1,75 @@
|
||||
{
|
||||
"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": 172,
|
||||
"dislikes": 372,
|
||||
"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\": \"25.2K\", \"totalSubmission\": \"59.3K\", \"totalAcceptedRaw\": 25206, \"totalSubmissionRaw\": 59339, \"acRate\": \"42.5%\"}",
|
||||
"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": true,
|
||||
"paidOnly": false,
|
||||
"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": "{\n \"mysql\": [\n \"Create table If Not Exists Employee (id int, month int, salary int)\"\n ],\n \"mssql\": [\n \"Create table Employee (id int, month int, salary int)\"\n ],\n \"oraclesql\": [\n \"Create table Employee (id int, month int, salary int)\"\n ],\n \"database\": true\n}",
|
||||
"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>\"]}",
|
||||
"libraryUrl": null,
|
||||
"adminUrl": null,
|
||||
"challengeQuestion": null,
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
69
算法题/[no content]find-leaves-of-binary-tree.json
Normal file
69
算法题/[no content]find-leaves-of-binary-tree.json
Normal file
File diff suppressed because one or more lines are too long
57
算法题/[no content]find-median-given-frequency-of-numbers.json
Normal file
57
算法题/[no content]find-median-given-frequency-of-numbers.json
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "571",
|
||||
"questionFrontendId": "571",
|
||||
"boundTopicId": null,
|
||||
"title": "Find Median Given Frequency of Numbers",
|
||||
"titleSlug": "find-median-given-frequency-of-numbers",
|
||||
"content": null,
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": true,
|
||||
"difficulty": "Hard",
|
||||
"likes": 217,
|
||||
"dislikes": 63,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Median Employee Salary\", \"titleSlug\": \"median-employee-salary\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "{\"headers\": {\"Numbers\": [\"num\", \"frequency\"]}, \"rows\": {\"Numbers\": [[0, 7], [1, 1], [2, 3], [3, 1]]}}",
|
||||
"categoryTitle": "Database",
|
||||
"contributors": [],
|
||||
"topicTags": [
|
||||
{
|
||||
"name": "Database",
|
||||
"slug": "database",
|
||||
"translatedName": null,
|
||||
"__typename": "TopicTagNode"
|
||||
}
|
||||
],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": null,
|
||||
"stats": "{\"totalAccepted\": \"18.2K\", \"totalSubmission\": \"40.9K\", \"totalAcceptedRaw\": 18234, \"totalSubmissionRaw\": 40930, \"acRate\": \"44.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "{\"headers\": {\"Numbers\": [\"num\", \"frequency\"]}, \"rows\": {\"Numbers\": [[0, 7], [1, 1], [2, 3], [3, 1]]}}",
|
||||
"metaData": "{\n \"mysql\": [\n \"Create table If Not Exists Numbers (num int, frequency int)\"\n ],\n \"mssql\": [\n \"Create table Numbers (num int, frequency int)\"\n ],\n \"oraclesql\": [\n \"Create table Numbers (num int, frequency int)\"\n ],\n \"database\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [
|
||||
"Create table If Not Exists Numbers (num int, frequency int)",
|
||||
"Truncate table Numbers",
|
||||
"insert into Numbers (num, frequency) values ('0', '7')",
|
||||
"insert into Numbers (num, frequency) values ('1', '1')",
|
||||
"insert into Numbers (num, frequency) values ('2', '3')",
|
||||
"insert into Numbers (num, frequency) values ('3', '1')"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
69
算法题/[no content]find-permutation.json
Normal file
69
算法题/[no content]find-permutation.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
78
算法题/[no content]find-the-celebrity.json
Normal file
78
算法题/[no content]find-the-celebrity.json
Normal file
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user