LCA is a Firefox browser extension that analyzes your LeetCode solutions using a custom Mistral AI agent and provides detailed algorithmic feedback directly inside the LeetCode interface.
The extension automatically extracts:
- Problem statement
- Constraints
- Submitted code
and sends them to a specialized AI reviewer that evaluates:
- Time complexity
- Space complexity
- Optimality
- TLE risk
- Cost breakdown
- Optimization opportunities
All results are displayed in an interactive analysis panel inside LeetCode.
- Search "Free LeetCode TC analyzer" (might not be available currently as its still in reviewing stage)
- click on the first icon, and install it. (I'll also attach the direct link after it publishes)
- go to https://mistral.ai/ and sign in
- go to https://console.mistral.ai/home to get your api key
- click on the 'Api Keys' section on the left side vertical bar
- After opening any leetcode question, you will see an purple 'Analyze' button on top right.
- Time Complexity
- Space Complexity
- Optimality Analysis
- TLE Risk Assessment
- Cost Breakdown
- Optimization Suggestions
- Big-O Time Complexity
- Big-O Space Complexity
- Exact Performance Formula
- Exact Memory Formula
- Detects the algorithmic paradigm used
- Determines whether the solution is asymptotically optimal
- Suggests superior approaches when available
Provides a block-by-block breakdown of:
- Time contribution
- Space contribution
- Important operations
Uses the problem constraints to:
- Estimate worst-case operation counts
- Evaluate TLE risk
- Highlight scalability issues
Generates actionable feedback describing:
- Why the current solution is suboptimal
- Which approach is better
- What conceptual shift is required
- Floating Analyze button
- Draggable analysis window
- Resizable panel
- Collapsible sections
- Copy summary functionality
- One-click reanalysis
Users provide their own Mistral API key through the extension settings page.
The key is stored locally using the browser storage API and is never hardcoded into the extension.
---
- Clone the repository:
git clone https://github.com/swan556/tc-analyzer-ext-
Open Firefox.
-
Navigate to:
about:debugging
- Select:
This Firefox
- Click:
Load Temporary Add-on
- Select:
manifest.json
- The extension will now be available on LeetCode problem pages.
-
Open the extension settings page.
-
Enter your Mistral API key.
-
Click Save.
The key will be stored locally and reused automatically.
The content script runs on LeetCode problem pages and:
- Extracts code from the Monaco editor
- Extracts the problem statement
- Extracts constraints
- Sends data to the background script
The background script:
- Retrieves the user's API key
- Sends requests to the Mistral API
- Receives the analysis response
- Returns the result to the content script
A custom Mistral agent performs:
- Complexity analysis
- Cost auditing
- Constraint evaluation
- Optimality checking
- Optimization recommendations
The analysis is rendered as an interactive dashboard directly inside LeetCode.
- JavaScript
- Firefox Extensions API
- Mistral AI
- HTML
- CSS
TC-ANALYZER-EXT/
├── content.js
├── background.js
├── options.html
├── options.js
├── manifest.json
└── README.md
- Chrome support
- Better operation count estimation
- Multiple AI providers
- Export reports
LCA is an educational tool intended to help developers understand algorithmic complexity and optimization opportunities. AI-generated analysis may occasionally be incorrect and should be used as a learning aid rather than a definitive source of truth.







