leetcode-solutions
收藏资源简介:
LeetCode Solutions数据集是一个开源数据集,包含LeetCode编程问题的解决方案,适用于代码生成、代码翻译和语言模型微调等任务。数据集提供两种配置:base和instruct。base配置以每行一个LeetCode问题的形式组织,包含问题ID(problem_id)、问题标题(title)以及C++、Java、Python、SQL和TypeScript五种编程语言的解决方案列(分别为cpp、java、python、sql、typescript),当某语言无对应解决方案时,该列值为null。各语言解决方案数量大致为:C++约3,495个,Java约3,371个,Python约3,169个,SQL约307个,TypeScript约69个。instruct配置是从base配置派生出的指令调优变体,专门用于代码翻译任务的微调,每行包含一个指令调优三元组:自然语言指令(instruction)、源代码(input)和目标代码(output),支持C++、Java和Python之间的双向翻译(如Python→Java和Java→Python作为独立行)。数据集来源于walkccc/LeetCode仓库(MIT许可证),使用tkeskin/llm-fine-tune工具构建,语言为英语,整体许可证为gpl-3.0。
LeetCode Solutions Dataset is an open-source dataset containing solutions to LeetCode programming problems, which is applicable to tasks such as code generation, code translation, and language model fine-tuning. The dataset provides two configurations: base and instruct. The base configuration organizes data as one LeetCode problem per line, including the problem ID (problem_id), problem title (title), and solution columns for five programming languages: C++, Java, Python, SQL, and TypeScript (with column names cpp, java, python, sql, typescript respectively). If a certain language has no corresponding solution, the value of that column is null. The approximate number of solutions for each language is: around 3,495 for C++, about 3,371 for Java, roughly 3,169 for Python, approximately 307 for SQL, and about 69 for TypeScript. The instruct configuration is an instruction-tuned variant derived from the base configuration, specifically intended for fine-tuning on code translation tasks. Each line contains an instruction-tuning triplet: natural language instruction (instruction), source code (input), and target code (output), supporting bidirectional translation between C++, Java and Python (e.g., Python→Java and Java→Python are presented as separate rows). The dataset is sourced from the walkccc/LeetCode repository under the MIT License, and constructed using the tkeskin/llm-fine-tune tool. It is in English, and the overall license is GPL-3.0.




