A Chrome extension that adds a "⚡ Analyze" button to LeetCode problem pages. It reads the code you've currently written in the editor and sends it to Groq's free LLM API to get:
- Time complexity
- Space complexity
- Correctness notes / edge cases
- Suggested improvements
- A cleaner approach, if one exists
Everything runs with your own Groq API key, stored locally in your
browser (chrome.storage.sync) — it's never sent anywhere except directly
to Groq's API.
- Go to https://console.groq.com/keys
- Sign in and click "Create API Key"
- Copy the key (starts with
gsk_...)
- Unzip this folder somewhere permanent (don't delete it afterwards).
- Open Chrome and go to
chrome://extensions - Turn on Developer mode (top-right toggle)
- Click Load unpacked
- Select the
leetcode-analyzerfolder
- Click the extension icon in the Chrome toolbar
- Paste your Groq API key
- Pick a model (Llama 3.3 70B is a good default — fast and free)
- Click Save settings
- Open any problem on
leetcode.com/problems/... - Write or paste your solution in the code editor
- Click the ⚡ Analyze button in the bottom-right corner
- A panel slides in from the right with the analysis
inject.js— runs in the page's own JS context (world: "MAIN") so it can readwindow.monacodirectly and pull the current code out of the Monaco editor model. This is necessary because Chrome extension content scripts normally run in an isolated world that can't see the page's own JS variables.content.js— runs in the isolated world (normal content script). It injects the floating button and results panel, asksinject.jsfor the current code viawindowCustomEvents, grabs the problem title/description from the DOM, and messages the background worker to run the analysis.background.js— the MV3 service worker. Holds your API key, builds the prompt, and calls Groq's OpenAI-compatible/chat/completionsendpoint withresponse_format: { type: "json_object" }so the model reliably returns structured JSON.popup.html/popup.js— settings UI for the API key and model choice.
- LeetCode changes its DOM/class names periodically. If the problem title or description stops being detected, the analysis still works (code is the important part) — it just has less context.
- Free Groq rate limits apply (generous, but not unlimited). If you hit a rate limit, the panel will show the error message from the API.
- This tool is for understanding and improving your own solutions — not a substitute for actually solving the problem yourself.

