Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

livecoding

A local JavaScript workspace for coding practice with an AI assistant. Give the assistant a problem URL or statement; it creates the description, starter function, and Vitest tests. You write the solution and debug it in your editor.

With an AI assistant

Open this repository in your AI coding tool.

Ask it to set up the workspace and add a problem:

Install the project dependencies and add https://leetcode.com/problems/throttle/.

Or just source and number and it will re-create from memory

Add leetcode 239

You can also paste a problem statement. Include the platform URL and starter signature when available, especially if the page requires a login.

The assistant creates three files under problems/<platform>/: a Markdown description, a JavaScript starter, and tests covering the examples and edge cases. The repository instructions tell it to leave the solution for you to implement.

Ask it to review once finished:

Review solution

For help without giving away the solution, try:

Give me a hint
Add edge-case tests for 2676 without changing my implementation.
Explain why this test fails. Give me a hint, but don't write the solution.

Manually

Requires Node.js 24 and pnpm 12.3.4. Tool versions are declared in .tool-versions, which mise also reads.

Install dependencies:

pnpm install --frozen-lockfile

Create three files per problem under problems/<platform>/:

problems/leetcode/2676-throttle.md       # statement, examples, constraints
problems/leetcode/2676-throttle.js       # exported starter function; implement it yourself
problems/leetcode/2676-throttle.test.js  # Vitest tests importing the function

Use a four-digit problem number and the URL slug for filenames. For platforms without numeric IDs, use just the slug. Write JavaScript as ES modules with named exports. See AGENTS.md for the full file and test conventions.

Run tests in watch mode, or run them once:

pnpm test
pnpm test:once

Filter by platform, problem number, or slug:

pnpm test leetcode
pnpm test 2676
pnpm test:once throttle

The shared test-utils/expect-result.js helper provides compact input/output failures:

import { expectResult } from '../../test-utils/expect-result.js'

expectResult(actual, expected, { nums, target })

Check the helper independently with:

pnpm test:once test-utils

Local problem files

The LeetCode, Codewars, and BigFrontEnd folders ignore all files except their own .gitignore, so your local statements, tests, and solutions stay out of Git. Add the same ignore file when creating another folder for third-party problems. Git ignore rules do not exclude files that are already tracked.

The problems/testgorilla-practice/ folder contains separate practice exercises and is included in the repository. Unfinished exercises may have failing tests.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages