convez.ai
PluginProdutividadeIntermediário
Robinbinu

LeetCode Helper

Robinbinu/leetcode_helper

Resolva problemas LeetCode com IA — múltiplos provedores, linguagens variadas

Ver no GitHub
InicialPluginScore · de 0 a 100

Aplicação full-stack que ajuda a resolver problemas do LeetCode usando múltiplos provedores de IA (OpenAI, Gemini, Claude, Groq). Backend em Go/Gin fornece API RESTful para gerar soluções estruturadas com explicações, código e dicas. Frontend em AstroJS com armazenamento seguro de chaves de API no navegador.

Instalação

$npx convez-ai Robinbinu/leetcode_helper

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 1 ano
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Preparação para entrevistas técnicas com soluções explicadas
  • Aprendizado de algoritmos com diferentes abordagens de IA
  • Prototipagem rápida de soluções em múltiplas linguagens

Veredito

Ferramenta prática que combina bem abstração de provedores com interface clara. Arquitetura limpa e tratamento seguro de credenciais por requisição. Ideia solidária para o nicho de preparação técnica, mas depende fortemente da qualidade do provedor de IA escolhido.

README

A tradução para o português deste README ainda está na fila.

LeetCode Helper Documentation

Overview

LeetCode Helper is a full-stack application that helps users solve LeetCode problems using various GenAI providers. The application consists of a Go (Gin-based) backend API and an AstroJS frontend. Users can input LeetCode problems, select their preferred programming language and AI provider, and receive structured solutions with explanations, code, and hints.

Architecture

The application follows a clean, modular architecture:

Backend (Go/Gin)

  • Provider Abstraction: Generic interface for multiple AI providers
  • API Endpoints: RESTful endpoints for solving problems and listing providers
  • Per-Request API Key Handling: API keys are passed with each request, not stored on the server

Frontend (AstroJS)

  • React Components: UI components for input, output, and API key management
  • Local Storage: Secure storage of API keys in the browser
  • Responsive Design: Works on both desktop and mobile devices

Installation

Prerequisites

  • Go 1.23 or higher
  • Node.js 16 or higher
  • npm or yarn

Backend Setup

  1. Clone the repository
  2. Navigate to the backend directory:
    cd leetcode-helper/backend
    
  3. Install Go dependencies:
    go mod tidy
    
  4. Run the backend server:
    go run main.go
    
    The server will start on port 8080.

Frontend Setup

  1. Navigate to the frontend directory:
    cd leetcode-helper/frontend
    
  2. Install dependencies:
    npm install
    
  3. Run the development server:
    npm run dev
    
    The frontend will be available at http://localhost:3000.

Usage

  1. Open the application in your browser
  2. Enter a LeetCode problem in the text area
  3. Select your preferred programming language and experience level
  4. Choose an AI provider from the dropdown
  5. Enter your API key for the selected provider
  6. Click "Solve Problem" to generate a solution
  7. View the explanation, code, and hints in the tabbed interface

API Endpoints

POST /api/solve

Generates a solution for a LeetCode problem.

Request Body:

{
  "problem_text": "Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.",
  "language": "javascript",
  "user_level": "intermediate",
  "provider": "openai",
  "api_key": "your-api-key"
}

Response:

{
  "explanation": "To solve this problem, we can use a hash map to store the numbers we've seen so far...",
  "code": "function twoSum(nums, target) {\n  const map = {};\n  for (let i = 0; i < nums.length; i++) {\n    const complement = target - nums[i];\n    if (map[complement] !== undefined) {\n      return [map[complement], i];\n    }\n    map[nums[i]] = i;\n  }\n  return [];\n}",
  "hints": [
    "Consider using a hash map to store values you've already seen",
    "For each number, check if its complement (target - num) exists in the hash map",
    "Time complexity can be reduced to O(n) with the right approach"
  ],
  "timeComplexity": "O(n)",
  "spaceComplexity": "O(n)"
}

GET /api/providers

Returns a list of available AI providers.

Response:

{
  "providers": ["openai", "gemini", "claude", "groq"]
}

Supported AI Providers

The application currently supports the following AI providers:

  1. OpenAI (GPT-4)

  2. Google Gemini

  3. Anthropic Claude

  4. Groq (Llama 3)

Adding New AI Providers

To add a new AI provider:

  1. Create a new file in the providers directory implementing the GenAIProvider interface
  2. Register the provider in main.go
  3. Add the provider to the frontend dropdown in ProblemInputForm.tsx

Example implementation:

package providers

import (
    "context"
    "github.com/leetcode-helper/api/models"
)

// NewProviderProvider creates a new provider
func NewProviderProvider() *ProviderProvider {
    return &ProviderProvider{
        baseURL: "https://api.provider.com/v1/completions",
    }
}

// GetName returns the name of the provider
func (p *ProviderProvider) GetName() string {
    return "provider"
}

// ValidateAPIKey checks if the API key is valid
func (p *ProviderProvider) ValidateAPIKey(apiKey string) bool {
    return len(apiKey) > 0
}

// GenerateSolution generates a solution for a LeetCode problem
func (p *ProviderProvider) GenerateSolution(ctx context.Context, problem string, language string, userLevel string, apiKey string) (*models.SolutionResponse, error) {
    // Implementation here
}

Security Considerations

  • API keys are stored only in the user's browser local storage
  • API keys are never stored on the server
  • API keys are sent directly from the frontend to the AI provider
  • HTTPS should be used in production to secure API key transmission

License

This project is licensed under the MIT License - see the LICENSE file for details.

Ver o original no GitHub

Bom para

Relacionados