A powerful Chrome extension that enhances your LeetCode experience with code analysis, complexity visualization, and improvement suggestions.
- Code Extraction - Automatically reads your code from LeetCode's editor
- Complexity Analysis - Detects time and space complexity with explanations
- Visual Charts - Beautiful graphs showing complexity growth curves
- Error Detection - Catches common mistakes before you submit
- Better Approaches - AI-powered suggestions for optimization
- C++ Support - Full support for C++ with extensible architecture for more languages
- Clone this repository
- Install dependencies:
npm install
- Build the extension:
npm run build
- Load in Chrome:
- Open
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
distfolder
- Open
npm run devThis starts Vite in watch mode with hot reload support.
- Navigate to any LeetCode problem page
- Click the NeatCode extension icon to open the side panel
- Write your solution in the LeetCode editor
- Click "Analyze Code" to get:
- Time & Space complexity analysis
- Visual complexity comparison chart
- Code issues and warnings
- Suggestions for better approaches
Click the gear icon in the side panel or right-click the extension icon > Options to:
- Add your OpenAI API key for enhanced AI analysis
- Toggle auto-analyze on code changes
- Configure preferred language settings
- TypeScript - Type-safe code
- React - UI components
- Vite - Fast builds with @crxjs/vite-plugin
- TailwindCSS - Styling
- Chart.js - Complexity visualizations
- Chrome Extension Manifest V3
src/
├── content/ # Content script (injected into LeetCode)
│ ├── index.ts # Entry point
│ ├── codeExtractor.ts
│ └── problemParser.ts
├── sidepanel/ # Side panel UI
│ ├── App.tsx
│ └── components/
├── background/ # Service worker
│ ├── index.ts
│ └── aiService.ts
├── analysis/ # Code analysis engine
│ ├── index.ts
│ └── languages/ # Language-specific analyzers
├── options/ # Settings page
├── utils/ # Shared utilities
└── types/ # TypeScript definitions
The analysis engine is designed to be extensible. To add support for a new language:
- Create a new analyzer in
src/analysis/languages/ - Extend
BaseLanguageAnalyzer - Register it in
src/analysis/index.ts
MIT