这个是leetcode分支

leetcode
lensfrex 2 years ago
parent eb49d342db
commit b790144d80
Signed by: lensfrex
GPG Key ID: 0F69A0A2FBEE98A0
  1. 101
      src/main/java/net/lensfrex/oj/collector/Collector.java
  2. 20
      src/main/java/net/lensfrex/oj/collector/Main.java
  3. 61
      src/main/java/net/lensfrex/oj/collector/Record.java
  4. 114
      src/main/java/net/lensfrex/oj/collector/data/QuestionDetail.java
  5. 154
      src/main/java/net/lensfrex/oj/collector/data/Result.java
  6. 32
      src/main/java/net/lensfrex/oj/collector/data/Sample.java
  7. 26
      src/main/java/net/lensfrex/oj/collector/data/Tag.java
  8. 25
      src/main/java/net/lensfrex/oj/collector/utils/NetworkUtil.java
  9. 1
      src/main/resources/details_request_body.txt
  10. 1
      src/main/resources/index_request_body.txt
  11. 8
      src/main/resources/leetcode-details-request.json
  12. 177
      src/main/resources/leetcode-details.json
  13. 63
      src/main/resources/leetcode-index.json
  14. 19
      src/main/resources/template.txt

@ -1,22 +1,25 @@
package net.lensfrex.oj.collector; package net.lensfrex.oj.collector;
import com.google.gson.Gson; import com.google.gson.*;
import com.google.gson.JsonArray; import net.lensfrex.oj.collector.data.QuestionDetail;
import com.google.gson.JsonParser; import net.lensfrex.oj.collector.utils.IOUtil;
import net.lensfrex.oj.collector.data.Result;
import net.lensfrex.oj.collector.utils.NetworkUtil; import net.lensfrex.oj.collector.utils.NetworkUtil;
import net.lensfrex.oj.collector.utils.Random;
import org.apache.http.client.utils.URIBuilder; import org.apache.http.client.utils.URIBuilder;
import java.io.IOException; import java.io.IOException;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
public class Collector { public class Collector {
private static final String API_BASE = "https://oj.wust-acm.top/api/problem"; private static final String API_BASE = "https://leetcode.cn/graphql/";
private static final String DETAILS_REQUEST_BODY = IOUtil.inputStreamToString(Record.class.getResourceAsStream("/details_request_body.txt"), StandardCharsets.UTF_8);
private static final String INDEX_REQUEST_BODY = IOUtil.inputStreamToString(Record.class.getResourceAsStream("/index_request_body.txt"), StandardCharsets.UTF_8);
private static final int PAGE_LIMIT = 100; private static final int PAGE_LIMIT = 100;
@ -33,61 +36,99 @@ public class Collector {
private HashMap<String, String> getHeaders() { private HashMap<String, String> getHeaders() {
HashMap<String, String> headers = new HashMap<>(); HashMap<String, String> headers = new HashMap<>();
headers.put("User-Agent", "lensfrex/0.0.1 CanYouSeeMe/0.0.2 IJustLearning/0.0.3"); headers.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.66 Safari/537.36 Edg/103.0.1264.44");
headers.put("Host", "oj.wust-acm.top"); headers.put("Host", "leetcode.cn");
headers.put("Origin", "https://leetcode.cn");
headers.put("Accept-Encoding", "gzip, deflate, br"); headers.put("Accept-Encoding", "gzip, deflate, br");
headers.put("Content-Type", "application/json");
return headers; return headers;
} }
private Result[] getResults(String url, Map<String, String> headers) throws IOException { //
String json = NetworkUtil.get(url, headers); // private QuestionDetail[] getResults(String url, Map<String, String> headers) throws IOException {
// String json = NetworkUtil.get(url, headers);
JsonArray resultJsonArray = JsonParser.parseString(json).getAsJsonObject() //
.getAsJsonObject("data") // JsonArray resultJsonArray = JsonParser.parseString(json).getAsJsonObject()
.getAsJsonArray("results"); // .getAsJsonObject("data")
// .getAsJsonArray("results");
return new Gson().fromJson(resultJsonArray, Result[].class); //
} // return new Gson().fromJson(resultJsonArray, QuestionDetail[].class);
// }
public ArrayList<Result> collectAllResults() {
ArrayList<Result> results = new ArrayList<>(); private final Record record = new Record();
private static final Random random = new Random();
public ArrayList<QuestionDetail> collectAllQuestion() {
ArrayList<QuestionDetail> QuestionDetails = new ArrayList<>();
try { try {
String url = generatePageRequestUrl(API_BASE, 0, 1, 1);
HashMap<String, String> headers = getHeaders(); HashMap<String, String> headers = getHeaders();
String json = NetworkUtil.get(url, headers); String json = NetworkUtil.post(API_BASE, String.format(INDEX_REQUEST_BODY, 0, 1), headers);
int totalResult = JsonParser.parseString(json).getAsJsonObject() int totalResult = JsonParser.parseString(json).getAsJsonObject()
.getAsJsonObject("data") .getAsJsonObject("data")
.getAsJsonObject("problemsetQuestionList")
.getAsJsonPrimitive("total").getAsInt(); .getAsJsonPrimitive("total").getAsInt();
int page = (totalResult / PAGE_LIMIT) + (totalResult % PAGE_LIMIT == 0 ? 0 : 1); int page = (totalResult / PAGE_LIMIT) + (totalResult % PAGE_LIMIT == 0 ? 0 : 1);
ArrayList<String> questionNames = new ArrayList<>(totalResult);
System.out.println("Total results: " + totalResult); System.out.println("Total results: " + totalResult);
System.out.println("Page Limit: " + PAGE_LIMIT); System.out.println("Page Limit: " + PAGE_LIMIT);
System.out.println("Total pages: " + page); System.out.println("Total pages: " + page);
// Fetch all question list
for (int i = 1; i <= page; i++) { for (int i = 1; i <= page; i++) {
int offset = (i - 1) * PAGE_LIMIT; int offset = (i - 1) * PAGE_LIMIT;
System.out.println("\n------------------------------------------------------"); System.out.println("\n------------------------------------------------------");
System.out.println("Getting page " + i); System.out.println("Getting page " + i);
System.out.println("Offset " + offset); System.out.println("Offset " + offset);
url = generatePageRequestUrl(API_BASE, offset, PAGE_LIMIT, i); json = NetworkUtil.post(API_BASE, String.format(INDEX_REQUEST_BODY, offset, PAGE_LIMIT), headers);
System.out.println("Request URL: " + url);
Result[] results1 = getResults(url, headers); JsonArray questionJsonArray =
JsonParser.parseString(json).getAsJsonObject()
.getAsJsonObject("data")
.getAsJsonObject("problemsetQuestionList")
.getAsJsonArray("questions");
results.addAll(Arrays.asList(results1)); for (JsonElement jsonElement : questionJsonArray) {
questionNames.add(jsonElement.getAsJsonObject().get("titleSlug").getAsString());
}
System.out.println("Successful get " + results1.length + " result(s)"); System.out.println("Got result " + questionJsonArray.size());
} }
} catch (URISyntaxException | IOException e) {
System.out.println("Total result: " + questionNames.size());
// Fetch all question details
QuestionDetail detail = null;
for (String questionTitleSlug : questionNames) {
System.out.println("Getting question: " + questionTitleSlug);
json = NetworkUtil.post(API_BASE, String.format(DETAILS_REQUEST_BODY, questionTitleSlug), headers);
JsonObject question =
JsonParser.parseString(json).getAsJsonObject()
.getAsJsonObject("data")
.getAsJsonObject("question");
detail = new Gson().fromJson(question, QuestionDetail.class);
record.writeToFile(
"D:\\ojs-leetcode",
String.valueOf(detail.getId()),
detail.getChineseTitle() == null ? detail.getTitle() : detail.getChineseTitle(),
record.fillText(detail));
Thread.sleep(random.getRandomNumber(120));
}
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
return results; System.out.println("Finish.");
return QuestionDetails;
} }
} }

@ -1,14 +1,12 @@
package net.lensfrex.oj.collector; package net.lensfrex.oj.collector;
import net.lensfrex.oj.collector.data.Result; import net.lensfrex.oj.collector.data.QuestionDetail;
import net.lensfrex.oj.collector.utils.IOUtil; import net.lensfrex.oj.collector.utils.IOUtil;
import net.lensfrex.oj.collector.utils.ParamFiller;
import java.io.IOException; import java.io.IOException;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
public class Main { public class Main {
@ -27,13 +25,13 @@ public class Main {
private void run() throws URISyntaxException, IOException { private void run() throws URISyntaxException, IOException {
Record record = new Record(); Record record = new Record();
ArrayList<Result> results = new Collector().collectAllResults(); ArrayList<QuestionDetail> questionResults = new Collector().collectAllQuestion();
//
String context = ""; // String context = "";
for (Result result : results) { // for (QuestionDetail questionResult : questionResults) {
context = record.fillText(result); // context = record.fillText(questionResult);
//
record.writeToFile(location, result.getId(), result.getTitle(), context); // record.writeToFile(location, String.valueOf(questionResult.getId()), questionResult.getChineseTitle(), context);
} // }
} }
} }

@ -1,64 +1,57 @@
package net.lensfrex.oj.collector; package net.lensfrex.oj.collector;
import net.lensfrex.oj.collector.data.Result; import net.lensfrex.oj.collector.data.QuestionDetail;
import net.lensfrex.oj.collector.data.Sample; import net.lensfrex.oj.collector.data.Tag;
import net.lensfrex.oj.collector.utils.IOUtil; import net.lensfrex.oj.collector.utils.IOUtil;
import net.lensfrex.oj.collector.utils.ParamFiller; import net.lensfrex.oj.collector.utils.ParamFiller;
import java.io.File; import java.io.File;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.ResourceBundle;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class Record { public class Record {
private static final String MAIN_TEMPLATE = IOUtil.inputStreamToString(Record.class.getResourceAsStream("/template.txt"), StandardCharsets.UTF_8); private static final String MAIN_TEMPLATE = IOUtil.inputStreamToString(Record.class.getResourceAsStream("/template.txt"), StandardCharsets.UTF_8);
private static final String EXAMPLE_TEMPLATE = IOUtil.inputStreamToString(Record.class.getResourceAsStream("/exampleTemplates.txt"), StandardCharsets.UTF_8);
public String fillText(Result results) { public String fillText(QuestionDetail results) {
System.out.println("Filling: " + results.getChineseTitle());
HashMap<String, String> params = new HashMap<>(); HashMap<String, String> params = new HashMap<>();
params.put("title", results.getTitle());
params.put("description", results.getDescription());
params.put("inputDescription", results.getInputDescription());
params.put("outputDescription", results.getOutputDescription());
params.put("timeLimit", results.getTimeLimit().toString());
params.put("memoryLimit", results.getMemoryLimit().toString());
params.put("level", results.getDifficulty());
params.put("id", results.getId());
params.put("tags", results.getTags().toString());
params.put("hint", results.getHint());
StringBuffer exampleStringBuffer = new StringBuffer(); if (results.isPaidOnly()) {
List<Sample> samples = results.getSamples(); params.put("englishContent", "这道题是~付~费~内容哦");
int sampleSize = samples.size(); } else {
for (int i = 0; i < sampleSize; i++) { params.put("englishContent", results.getTitle());
exampleStringBuffer.append(fillExampleText(samples.get(i), i + 1));
} }
params.put("examples", exampleStringBuffer.toString()); params.put("englishTitle", results.getTitle());
params.put("title", results.getChineseTitle());
params.put("content", results.getChineseContent());
params.put("hints", results.getDifficulty());
params.put("id", results.getId());
return ParamFiller.fill(MAIN_TEMPLATE, params); StringBuilder tagStringBuilder = new StringBuilder();
} List<Tag> tags = results.getTags();
for (Tag tag : tags) {
tagStringBuilder.append('[').append(tag.getChineseName()).append("] ");
}
private String fillExampleText(Sample sample, int index) { params.put("tags", tagStringBuilder.toString());
HashMap<String, String> params = new HashMap<>();
if (index == 1) {
params.put("index", "");
} else { StringBuilder hintStringBuilder = new StringBuilder();
params.put("index", String.valueOf(index)); List<String> hints = results.getHints();
for (String hint : hints) {
hintStringBuilder.append('[').append(hint).append("]\n\n");
} }
params.put("inputExamples", sample.getInput());
params.put("outputExamples", sample.getOutput());
return ParamFiller.fill(EXAMPLE_TEMPLATE, params); params.put("hints", hintStringBuilder.toString());
return ParamFiller.fill(MAIN_TEMPLATE, params);
} }
private static final Pattern FilePattern = Pattern.compile("[\\\\/:*?\"<>|]"); private static final Pattern FilePattern = Pattern.compile("[\\\\/:*?\"<>|]");
public static String filenameFilter(String str) { private static String filenameFilter(String str) {
return str == null ? null : FilePattern.matcher(str).replaceAll(""); return str == null ? null : FilePattern.matcher(str).replaceAll("");
} }

@ -0,0 +1,114 @@
package net.lensfrex.oj.collector.data;
import com.google.gson.annotations.SerializedName;
import java.util.List;
@SuppressWarnings("unused")
public class QuestionDetail {
@SerializedName("questionFrontendId")
private String id;
private String title;
@SerializedName("translatedTitle")
private String chineseTitle;
private String content;
@SerializedName("translatedContent")
private String chineseContent;
private String difficulty;
private List<String> hints;
@SerializedName("topicTags")
private List<Tag> tags;
private boolean isPaidOnly;
public boolean isPaidOnly() {
return isPaidOnly;
}
public void setPaidOnly(boolean paidOnly) {
isPaidOnly = paidOnly;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getChineseTitle() {
return chineseTitle;
}
public void setChineseTitle(String chineseTitle) {
this.chineseTitle = chineseTitle;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String getChineseContent() {
return chineseContent;
}
public void setChineseContent(String chineseContent) {
this.chineseContent = chineseContent;
}
public String getDifficulty() {
return difficulty;
}
public void setDifficulty(String difficulty) {
this.difficulty = difficulty;
}
public List<String> getHints() {
return hints;
}
public void setHints(List<String> hints) {
this.hints = hints;
}
public List<Tag> getTags() {
return tags;
}
public void setTags(List<Tag> tags) {
this.tags = tags;
}
@Override
public String toString() {
String sb = "QuestionDetail{" + "id=" + id +
", title='" + title + '\'' +
", chineseTitle='" + chineseTitle + '\'' +
", content='" + content + '\'' +
", chineseContent='" + chineseContent + '\'' +
", difficulty='" + difficulty + '\'' +
", hints=" + hints +
", tags=" + tags +
'}';
return sb;
}
}

@ -1,154 +0,0 @@
package net.lensfrex.oj.collector.data;
import java.util.List;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class Result {
@SerializedName("_id")
private String id;
@Expose
private String title;
@Expose
private Object contest;
@Expose
private String description;
@SerializedName("input_description")
private String inputDescription;
@SerializedName("output_description")
private String outputDescription;
@Expose
private String difficulty;
@Expose
private String hint;
@SerializedName("memory_limit")
private Long memoryLimit;
@SerializedName("time_limit")
private Long timeLimit;
@Expose
private List<Sample> samples;
@Expose
private List<String> tags;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Object getContest() {
return contest;
}
public void setContest(Object contest) {
this.contest = contest;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDifficulty() {
return difficulty;
}
public void setDifficulty(String difficulty) {
this.difficulty = difficulty;
}
public String getHint() {
return hint;
}
public void setHint(String hint) {
this.hint = hint;
}
public Long getMemoryLimit() {
return memoryLimit;
}
public void setMemoryLimit(Long memoryLimit) {
this.memoryLimit = memoryLimit;
}
public Long getTimeLimit() {
return timeLimit;
}
public void setTimeLimit(Long timeLimit) {
this.timeLimit = timeLimit;
}
public String getInputDescription() {
return inputDescription;
}
public void setInputDescription(String inputDescription) {
this.inputDescription = inputDescription;
}
public String getOutputDescription() {
return outputDescription;
}
public void setOutputDescription(String outputDescription) {
this.outputDescription = outputDescription;
}
public List<Sample> getSamples() {
return samples;
}
public void setSamples(List<Sample> samples) {
this.samples = samples;
}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("Result{");
sb.append("id='").append(id).append('\'');
sb.append(", title='").append(title).append('\'');
sb.append(", contest=").append(contest);
sb.append(", description='").append(description).append('\'');
sb.append(", difficulty='").append(difficulty).append('\'');
sb.append(", hint='").append(hint).append('\'');
sb.append(", memoryLimit=").append(memoryLimit);
sb.append(", timeLimit=").append(timeLimit);
sb.append(", inputDescription='").append(inputDescription).append('\'');
sb.append(", outputDescription='").append(outputDescription).append('\'');
sb.append(", samples=").append(samples);
sb.append(", tags=").append(tags);
sb.append('}');
return sb.toString();
}
}

@ -1,32 +0,0 @@
package net.lensfrex.oj.collector.data;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
@Generated("net.hexar.json2pojo")
@SuppressWarnings("unused")
public class Sample {
@Expose
private String input;
@Expose
private String output;
public String getInput() {
return input;
}
public void setInput(String input) {
this.input = input;
}
public String getOutput() {
return output;
}
public void setOutput(String output) {
this.output = output;
}
}

@ -0,0 +1,26 @@
package net.lensfrex.oj.collector.data;
import com.google.gson.annotations.SerializedName;
public class Tag {
private String name;
@SerializedName("translatedName")
private String chineseName;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getChineseName() {
return chineseName;
}
public void setChineseName(String chineseName) {
this.chineseName = chineseName;
}
}

@ -4,7 +4,12 @@ import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException; import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.ResponseHandler; import org.apache.http.client.ResponseHandler;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
@ -21,6 +26,26 @@ public class NetworkUtil {
public static final String REQUEST_USERAGENT = "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.7113.93 Safari/537.36"; public static final String REQUEST_USERAGENT = "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.7113.93 Safari/537.36";
public static String post(String url, String data, Map<String, String> headers) throws IOException {
CloseableHttpClient httpClient = HttpClients.createDefault();
RequestConfig requestConfig = RequestConfig.custom().setCookieSpec(CookieSpecs.STANDARD).build();
HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(requestConfig);
for (String key : headers.keySet()) {
httpPost.setHeader(key, headers.get(key));
}
ResponseHandler<String> responseHandler = new BasicResponseHandler();
httpPost.setEntity(new StringEntity(data, "utf-8"));
String response = httpClient.execute(httpPost, responseHandler);
httpClient.close();
return response;
}
public static String get(String url, Map<String, String> headers) throws IOException { public static String get(String url, Map<String, String> headers) throws IOException {
CloseableHttpClient httpClient = HttpClients.createDefault(); CloseableHttpClient httpClient = HttpClients.createDefault();
// HttpGet httpGet = new HttpGet("https://oj.wust-acm.top/api/problem?paging=true&offset=0&limit=10&page=1"); // HttpGet httpGet = new HttpGet("https://oj.wust-acm.top/api/problem?paging=true&offset=0&limit=10&page=1");

@ -0,0 +1 @@
{"operationName":"questionData","variables":{"titleSlug":"%s"},"query":"query questionData($titleSlug: String!) { question(titleSlug: $titleSlug) { questionId questionFrontendId categoryTitle boundTopicId title titleSlug content translatedTitle translatedContent isPaidOnly difficulty likes dislikes isLiked similarQuestions contributors { username profileUrl avatarUrl __typename } langToValidPlayground topicTags { name slug translatedName __typename } companyTagStats codeSnippets { lang langSlug code __typename } stats hints solution { id canSeeDetail __typename } status sampleTestCase metaData judgerAvailable judgeType mysqlSchemas enableRunCode envInfo book { id bookName pressName source shortDescription fullDescription bookImgUrl pressImgUrl productUrl __typename } isSubscribed isDailyQuestion dailyRecordStatus editorType ugcQuestionId style exampleTestcases jsonExampleTestcases __typename }}"}

@ -0,0 +1 @@
{"query":" query problemsetQuestionList($categorySlug: String, $limit: Int, $skip: Int, $filters: QuestionListFilterInput) { problemsetQuestionList( categorySlug: $categorySlug limit: $limit skip: $skip filters: $filters ) { hasMore total questions { acRate difficulty freqBar frontendQuestionId isFavor paidOnly solutionNum status title titleCn titleSlug topicTags { name nameTranslated id slug } extra { hasVideoSolution topCompanyTags { imgUrl slug numSubscribed } } } }} ","variables":{"categorySlug":"","skip":%d,"limit":%d,"filters":{}}}

@ -0,0 +1,8 @@
{
"operationName": "questionData",
"variables": {
"titleSlug": "two-sum"
},
"query": "query questionData($titleSlug: String!) {\n question(titleSlug: $titleSlug) {\n questionId\n questionFrontendId\n categoryTitle\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 contributors {\n username\n profileUrl\n avatarUrl\n __typename\n }\n langToValidPlayground\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 __typename\n }\n status\n sampleTestCase\n metaData\n judgerAvailable\n judgeType\n mysqlSchemas\n enableRunCode\n envInfo\n book {\n id\n bookName\n pressName\n source\n shortDescription\n fullDescription\n bookImgUrl\n pressImgUrl\n productUrl\n __typename\n }\n isSubscribed\n isDailyQuestion\n dailyRecordStatus\n editorType\n ugcQuestionId\n style\n exampleTestcases\n jsonExampleTestcases\n __typename\n }\n}\n"
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,63 @@
{
"data": {
"problemsetQuestionList": {
"__typename": "QuestionListNode",
"questions": [
{
"__typename": "QuestionLightNode",
"acRate": 0.5265447404489151,
"difficulty": "EASY",
"freqBar": 0,
"paidOnly": false,
"status": "NOT_STARTED",
"frontendQuestionId": "1",
"isFavor": false,
"solutionNum": 18322,
"title": "Two Sum",
"titleCn": "两数之和",
"titleSlug": "two-sum",
"topicTags": [
{
"id": "wg0rh",
"name": "Array",
"slug": "array",
"nameTranslated": "数组",
"__typename": "CommonTagNode"
},
{
"id": "wzve3",
"name": "Hash Table",
"slug": "hash-table",
"nameTranslated": "哈希表",
"__typename": "CommonTagNode"
}
],
"extra": {
"companyTagNum": 394,
"hasVideoSolution": true,
"topCompanyTags": [
{
"imgUrl": "https://pic.leetcode-cn.com/5352d58e4b296e0704f20cfd99ecaec7af71d079b015923c72928650312c55b8-Messages Image(3349252251).png",
"slug": "amazon",
"__typename": "CommonTagNode"
},
{
"imgUrl": "https://pic.leetcode-cn.com/45a64add888e66ff6d3c551bed948528715996937b877aaf6fdc08eae74789f5-google-logo-png-open-2000.png",
"slug": "google",
"__typename": "CommonTagNode"
},
{
"imgUrl": "https://pic.leetcode-cn.com/cca55ecdfb504378955a9bf4f2f33897bb84f04f9cbf84ea96321ce5d959ee13-adobe1.png",
"slug": "adobe",
"__typename": "CommonTagNode"
}
],
"__typename": "QuestionExtraInfoNode"
}
}
],
"hasMore": true,
"total": 2696
}
}
}

@ -1,25 +1,20 @@
# {{title}} # {{englishTitle}} | {{title}}
-------------------------------- --------------------------------
## 题目: ## 题目:
{{description}} {{englishContent}}
## 输入: ---
> {{inputDescription}}
## 输出: {{content}}
> {{outputDescription}}
-------------------------------- --------------------------------
## 提示:{{hint}} ## 提示:
{{examples}} {{hints}}
-------------------------------- --------------------------------
- 时间限制:{{timeLimit}} - 难度:{{level}}
- 内存限制:{{memoryLimit}}
- 等级:{{level}}
- id:{{id}} - id:{{id}}
- 标签:{{tags}} - 标签:{{tags}}

Loading…
Cancel
Save