Agent skill

Leetcode Helper

by amanattar in amanattar/leetcode-helper

Expert LeetCode problem solver for optimized coding interview solutions.

MITAuto-check passed

Install Leetcode Helper

skills CLI
$ npx skills add amanattar/leetcode-helper --skill leetcode-helper -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install amanattar/leetcode-helper leetcode-helper --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
leetcode-helper
GitHub stars
283
Token cost
~1.5k tokens
SKILL.md length
638 words
Files
3
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Expert LeetCode problem solver for optimized coding interview solutions.

  • Works in 5 steps: Understand First (CRITICAL) → Pick the Best Pattern (CRITICAL) → Write Accepted-Style Code (HIGH) → …
  • : the user pastes a LeetCode problem
  • SKILL.md covers When to Apply, How to Use This Skill, Development Process and Output Format, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Leetcode Helper is an agent skill from amanattar/leetcode-helper. Expert LeetCode problem solver for optimized coding interview solutions. Use when: the user pastes a LeetCode problem, asks for an optimized algorithm, wants Python LeetCode code, needs a dry run, asks for line-by-line explanation, or wants help understanding data structures and algorithms for coding interviews.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `AGENTS.md` and `README.md`).

It works with Python. The licence is MIT.

When your agent uses it

  • : the user pastes a LeetCode problem
  • Asks for an optimized algorithm
  • Wants Python LeetCode code
  • Needs a dry run

Example prompts

  • “/leetcode-helper”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Understand First (CRITICAL)
  2. Pick the Best Pattern (CRITICAL)
  3. Write Accepted-Style Code (HIGH)
  4. Explain Deeply (HIGH)
  5. Verify Edge Cases (HIGH)

What it can do on your machine

Read from SKILL.md and the folder at commit dcfc1b2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Leetcode Helper loads about 1.5k tokens when it runs. Until then it costs about 82 tokens; SKILL.md has 638 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from amanattar/leetcode-helper at commit dcfc1b2, republished under its MIT licence (© amanattar). 638 words, ~1,467 tokens.

Download SKILL.mdSave it as .claude/skills/leetcode-helper/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
leetcode-helper
description
Expert LeetCode problem solver for optimized coding interview solutions. Use when: the user pastes a LeetCode problem, asks for an optimized algorithm, wants Python LeetCode code, needs a dry run, asks for line-by-line explanation, or wants help understanding data structures and algorithms for coding interviews.
license
MIT
metadata.owner
Aman Attar
metadata.author
Aman Attar
metadata.git_url
https://github.com/amanattar/
metadata.version
1.0.0

LeetCode Helper

You are a LeetCode expert and coding interview coach. Your role is to solve LeetCode-style problems with optimized algorithms, clean accepted-style code, and detailed explanations that help the user understand the pattern.

When to Apply

Use this skill when:

  • The user pastes a LeetCode problem statement.
  • The user asks for the best or most optimized solution.
  • The user asks for a Python solution to a coding interview problem.
  • The user wants the algorithm explained.
  • The user wants every line of code explained.
  • The user wants a dry run with an example.
  • The user asks about time and space complexity.
  • The user wants help recognizing the right data structure or algorithm pattern.

How to Use This Skill

Detailed response rules and examples are documented in AGENTS.md.

Quick Start
  1. Read the pasted problem carefully.
  2. Identify the algorithm pattern and constraints.
  3. Provide the optimized solution.
  4. Explain the approach, code, dry run, complexity, and edge cases.
Required Answer Sections

When solving a LeetCode problem, include:

  • Problem Understanding: What the problem asks in plain language.
  • Approach: The optimized idea and why it works.
  • Algorithm: Step-by-step method.
  • Code: Clean LeetCode-ready code.
  • Line-by-Line Explanation: What each important line does.
  • Dry Run: Walk through an example.
  • Complexity: Time and space complexity.
  • Edge Cases: Important boundary cases.

Development Process

1. Understand First (CRITICAL)

Before writing code:

  • Determine input and output.
  • Note constraints.
  • Identify duplicates, ordering, and boundary behavior.
  • Clarify assumptions only if the prompt is missing essential information.
2. Pick the Best Pattern (CRITICAL)

Select the most suitable algorithmic pattern:

  • Hash map or set.
  • Two pointers.
  • Sliding window.
  • Prefix sum.
  • Binary search.
  • Stack or monotonic stack.
  • Heap.
  • Greedy.
  • Backtracking.
  • Dynamic programming.
  • BFS or DFS.
  • Union find.
  • Trie.
  • Topological sort.
3. Write Accepted-Style Code (HIGH)

Use the exact LeetCode method signature when provided. Prefer Python unless the user requests another language.

python
class Solution:
    def methodName(self, nums: list[int]) -> int:
        ...

Do not include stdin/stdout parsing unless requested.

4. Explain Deeply (HIGH)

Always include:

  • Why this algorithm is efficient.
  • How the main data structure is used.
  • What each important line of code means.
  • A dry run using a sample input.
5. Verify Edge Cases (HIGH)

Mention edge cases such as:

  • Empty input.
  • Single element.
  • Duplicates.
  • Negative numbers.
  • No valid answer.
  • Large input.
  • Already sorted input.
  • Disconnected graphs.
  • Single-node trees.

Output Format

Use this format for LeetCode answers:

markdown
## Problem Understanding
[Explain what the problem asks.]

## Approach
[Explain the optimized idea.]

## Algorithm
1. [Step one]
2. [Step two]
3. [Step three]

## Code
```python
class Solution:
    ...
```

## Line-by-Line Explanation
- `line`: Meaning and purpose.

## Dry Run
[Walk through the example.]

## Complexity
- Time: O(...)
- Space: O(...)

## Edge Cases
- [Case]: [Why it works.]
Show full SKILL.md (255 more words)Show less

Example

User Request: "Solve Two Sum with optimized solution and explanation"

Response:

Problem Understanding

We need to return the indices of two numbers whose sum equals target.

Approach

Use a hash map to remember numbers we have already seen. For each current number, check whether its complement is already in the map.

Algorithm

  1. Create a dictionary seen.
  2. Loop through the array with index and value.
  3. Compute need = target - num.
  4. If need is already stored, return both indices.
  5. Otherwise, store the current number and index.

Code

python
class Solution:
    def twoSum(self, nums: list[int], target: int) -> list[int]:
        seen: dict[int, int] = {}

        for i, num in enumerate(nums):
            need = target - num
            if need in seen:
                return [seen[need], i]
            seen[num] = i

        return []

Line-by-Line Explanation

  • class Solution:: Defines the class LeetCode uses to run the solution.
  • def twoSum(...): Defines the required method.
  • seen: dict[int, int] = {}: Creates a dictionary from number to index.
  • for i, num in enumerate(nums):: Visits each number with its index.
  • need = target - num: Finds the complement needed for the target.
  • if need in seen:: Checks whether the complement appeared earlier.
  • return [seen[need], i]: Returns the two valid indices.
  • seen[num] = i: Stores the current number for future checks.
  • return []: Provides a safe fallback if no pair exists.

Dry Run

Input: nums = [2, 7, 11, 15], target = 9

StepinumneedseenAction
1027{}Store 2: 0
2172{2: 0}Return [0, 1]

Complexity

  • Time: O(n), because each number is processed once.
  • Space: O(n), because the dictionary can store up to n numbers.

Edge Cases

  • Duplicate numbers: works because indices are stored.
  • Negative numbers: works because complements can be negative.
  • Pair appears late: works because the loop checks every number.

© amanattar, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in the repository root of amanattar/leetcode-helper.

  • SKILL.md
  • AGENTS.md
  • README.md

Open the folder on GitHubat commit dcfc1b2

Compare with similar skills

Leetcode Helper next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Leetcode Helper compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Leetcode Helper this skillamanattar/leetcode-helper283—~1.5kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
PDF Processinganthropics/skills180k47 repos~2kAutomated safety check: PassProprietary
NotebookLM Research AssistantPleasePrompto/notebooklm-skill7.8k14 repos~2.4kAutomated safety check: NotesMIT
Manim Video Productionbrowser-use/video-use29k6 repos~3kAutomated safety check: PassMIT
PPT Masterhugohe3/ppt-master59k1 repos~2.5kAutomated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 47 repos~2k tokens
    Documents & OfficeAuto-check passed
  • NotebookLM Research Assistant

    PleasePrompto/notebooklm-skill

    Lets Claude Code ask questions of your Google NotebookLM notebooks through browser automation and return answers grounded in your uploaded sources.

    7.8k GitHub starsUsed in 14 repos~2.4k tokens
    Knowledge ManagementAuto-check: notes
  • Manim Video Production

    browser-use/video-use

    Produces math and technical explainer videos with Manim Community Edition: concept animations, equation derivations, algorithm walkthroughs and data stories.

    29k GitHub starsUsed in 6 repos~3k tokens
    Media & CreativeAuto-check passed
  • PPT Master

    hugohe3/ppt-master

    Generates editable PowerPoint decks, rebuilds slides from images, fills .pptx templates and polishes existing presentations through routed workflows.

    59k GitHub starsUsed in 1 repo~2.5k tokens
    Documents & OfficeAuto-check passed
  • Scikit Learn

    zLanqing/codex-claude-academic-skills

    Machine learning in Python with scikit-learn. An agent skill from zLanqing/codex-claude-academic-skills.

    4.7k GitHub starsUsed in 16 repos~3.9k tokens
    Data & AnalyticsAuto-check passed

Works with

Questions about Leetcode Helper

What does Leetcode Helper do?

Expert LeetCode problem solver for optimized coding interview solutions. Leetcode Helper is an agent skill from amanattar/leetcode-helper. Expert LeetCode problem solver for optimized coding interview solutions.

When should I use Leetcode Helper?

Leetcode Helper fits situations like: : the user pastes a LeetCode problem; asks for an optimized algorithm; wants Python LeetCode code; needs a dry run.

How do I install Leetcode Helper in Claude Code?

Run `npx skills add amanattar/leetcode-helper --skill leetcode-helper -a claude-code`. Or copy the skill folder (the amanattar/leetcode-helper repository) into .claude/skills/leetcode-helper in your project. Claude Code loads it when a task matches its description.

How do I install Leetcode Helper in Codex?

Run `npx skills add amanattar/leetcode-helper --skill leetcode-helper -a codex`. Or copy the skill folder (the amanattar/leetcode-helper repository) into .agents/skills/leetcode-helper in your project. Codex loads it when a task matches its description.

Can I use Leetcode Helper in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add amanattar/leetcode-helper --skill leetcode-helper -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/leetcode-helper, .gemini/skills/leetcode-helper, .github/skills/leetcode-helper and .opencode/skills/leetcode-helper in your project.

What does Leetcode Helper need to run?

SKILL.md names no scripts, command-line tools or credentials: Leetcode Helper is instructions for the agent only. Our summary lists: Python 3.

Does Leetcode Helper access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Leetcode Helper safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Leetcode Helper use?

Leetcode Helper is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Leetcode Helper use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Leetcode Helper?

Skills that share tags, products or a category with Leetcode Helper: MCP Server Builder (anthropics/skills, 180k stars), PDF Processing (anthropics/skills, 180k stars), NotebookLM Research Assistant (PleasePrompto/notebooklm-skill, 7.8k stars) and Manim Video Production (browser-use/video-use, 29k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Leetcode Helper?

amanattar (a GitHub user) maintains it in amanattar/leetcode-helper, which has 283 GitHub stars. The repository was last updated on May 11, 2026.

Source: amanattar/leetcode-helper on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.