CoolFace
Datasetpublic

AmareshHebbar/leetcode-codegen-java

LeetCode Code-Gen Dataset — Java 4068 rows. Given a problem statement, its input/output examples, and a required algorithm/technique, generate a correct Java solution. Part of a 4-language collection built from the same source: see the sibling Python, Java, C++, and JavaScript datasets. Verification Not execution-verified. There is currently no compiler/runtime harness for this language in the build pipeline (only Python has one). Rows are extracted directly from… See the full description on the dataset page: https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-java.

sourceHugging Facemitupdated 3mo agoView on Hugging Face
0likes55downloads
README.md76 linesDownload Raw Back to root
1---2license: mit3task_categories:4- text-generation5language:6- en7pretty_name: LeetCode Code-Gen (Java)8size_categories:9- 1K<n<10K10tags:11- code12- java13- leetcode14- algorithms15- code-generation16- competitive-programming17- instruction-tuning18- sft19---20 21# LeetCode Code-Gen Dataset — Java22 234068 rows. Given a problem statement, its input/output examples, and a24required algorithm/technique, generate a correct Java solution.25 26Part of a 4-language collection built from the same source: see the sibling27[Python](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-python),28[Java](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-java),29[C++](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-cpp), and30[JavaScript](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-javascript)31datasets.32 33## Verification34 35**Not execution-verified.** There is currently no compiler/runtime harness for this language in the build pipeline (only Python has one). Rows are extracted directly from named solution approaches in [doocs/leetcode](https://github.com/doocs/leetcode), a well-maintained community solutions repo, so correctness is likely but not guaranteed. Treat this the way you'd treat any unverified scraped code dataset.36 37## Source38 39Extracted from [doocs/leetcode](https://github.com/doocs/leetcode), which40documents multiple named solution approaches per problem (e.g. "Dynamic41Programming", "Two Pointers", "Divide and Conquer") -- this is what makes42per-row algorithm labeling possible, since the same problem can appear43multiple times with a different technique and different code each time.44 45## Fields46 47| field | description |48|---|---|49| `slug` | LeetCode problem slug |50| `solution_id` | unique id: problem + approach index + language |51| `primary_algorithm` | normalized algorithm/technique label |52| `verified` | `true`/`false` for Python (execution-checked), `null` for other languages |53| `messages` | chat-format (system/user/assistant), ready for SFT |54 55## Example row56 57```json58{59  "slug": "house-robber",60  "primary_algorithm": "Dynamic Programming",61  "messages": [62    {"role": "system", "content": "You are a competitive programming assistant..."},63    {"role": "user", "content": "### Problem\n...\n### Algorithm\nDynamic Programming"},64    {"role": "assistant", "content": "```java\n...\n```"}65  ]66}67```68 69## Known gaps70 71- SQL/database problems excluded (wrong problem type for a code-execution harness)72- Design/class problems (LRU Cache, iterators) excluded -- they need a73  sequence of method calls to test, not a single input -> output check74- Some `Brute Force` labels are a fallback where the source didn't name a75  specific technique for that approach76