|
| 1 | +# LeetCode Learning Assistant 🚀 |
| 2 | + |
| 3 | + |
| 4 | +_A Chrome extension to supercharge your LeetCode problem-solving with AI-powered guidance._ |
| 5 | + |
| 6 | +## Table of Contents |
| 7 | + |
| 8 | +- [Project Overview](#project-overview) |
| 9 | +- [Features](#features) |
| 10 | +- [Browser Support](#browser-support) |
| 11 | +- [Prerequisites](#prerequisites) |
| 12 | +- [Screenshots](#screenshots) |
| 13 | +- [How It Works](#how-it-works) |
| 14 | +- [Installation](#installation) |
| 15 | + - [API Key Setup](#api-key-setup) |
| 16 | + - [Using in LeetCode](#using-in-leetcode) |
| 17 | +- [File Structure](#file-structure) |
| 18 | +- [Technologies Used](#technologies-used) |
| 19 | +- [Contributing](#contributing) |
| 20 | + |
| 21 | +## Project Overview |
| 22 | + |
| 23 | +The **LeetCode Learning Assistant** is a Chrome extension designed to enhance your LeetCode problem-solving experience. It integrates directly into LeetCode problem pages, providing a sleek, sliding panel with **AI-powered** guidance using the **Gemini 2.5 Flash** API. From high-level hints to complete Java solutions and complexity analysis, this tool supports coders at all levels with a structured, step-by-step learning path. Its modern UI, robust error handling, and secure API key management make it a must-have for mastering coding challenges. |
| 24 | + |
| 25 | +## Features |
| 26 | + |
| 27 | +- **Seamless Integration**: Adds an "Analyze Problem" button on LeetCode problem pages. |
| 28 | +- **Structured Guidance**: |
| 29 | + 1. **Hints**: 3-4 concise, numbered hints to spark logical thinking without revealing solutions. |
| 30 | + 2. **Algorithmic Approach**: Outlines the optimal data structure and algorithm with numbered steps. |
| 31 | + 3. **Pseudocode**: Language-agnostic pseudocode in numbered steps for clarity. |
| 32 | + 4. **Solution**: Complete, well-commented Java code with a flow explanation. |
| 33 | + 5. **Complexity Analysis**: Time and space complexity with concise reasoning. |
| 34 | +- **Modern UI**: Responsive sliding panel with custom scrollbar and syntax-highlighted code. |
| 35 | +- **Secure API Key Storage**: Save your Gemini API key via the extension popup. |
| 36 | +- **Robust Error Handling**: Clear error messages and retry logic for API failures. |
| 37 | +- **Formatted Responses**: Markdown-formatted output with proper code blocks for readability. |
| 38 | + |
| 39 | + |
| 40 | +## Browser Support |
| 41 | + |
| 42 | +The extension is fully tested and supported on: |
| 43 | +- **Google Chrome** |
| 44 | +- **Microsoft Edge** |
| 45 | + |
| 46 | +It also work on other Chromium-based browsers (e.g., **Brave**, **Opera**), but official support to Chrome and Edge. |
| 47 | + |
| 48 | + |
| 49 | +## Prerequisites |
| 50 | + |
| 51 | +Before installing, ensure you have: |
| 52 | +- **Google Chrome** or **Microsoft Edge** (latest version recommended). |
| 53 | +- A valid **Gemini API key** from [Google AI Studio](https://aistudio.google.com/). |
| 54 | + |
| 55 | + |
| 56 | +## Screenshots |
| 57 | + |
| 58 | +| Image | Description | |
| 59 | +|-------|-------------| |
| 60 | +|  | Shows the extension icon and API key settings popup. | |
| 61 | +|  | Displays the "Analyze Problem" button on a LeetCode problem page. | |
| 62 | +|  | Shows the main sliding panel of the LeetCode Learning Assistant. | |
| 63 | +|  | Displays AI-generated content (e.g., hints or code) in the panel. | |
| 64 | + |
| 65 | + |
| 66 | +## How It Works |
| 67 | + |
| 68 | +### API Key Setup |
| 69 | +1. Click the **extension icon** in the browser toolbar to open the **API Key** popup. |
| 70 | +2. Enter your **Gemini API key** in the input field. |
| 71 | +3. Click **"Save Key"** to store the key securely. |
| 72 | +4. Verify the confirmation message (green for success, red for errors). |
| 73 | + |
| 74 | +### Using in LeetCode |
| 75 | +1. Navigate to a LeetCode problem page (e.g., `https://leetcode.com/problems/two-sum/`). |
| 76 | +2. Click the **"Analyze Problem"** button to open the sliding assistant panel. |
| 77 | +3. Use the **"Reveal"** buttons to access: |
| 78 | + - **Hints**: 3-4 short hints to guide your thinking. |
| 79 | + - **Approach**: Data structure and algorithm details. |
| 80 | + - **Pseudocode**: Step-by-step pseudocode for the optimal solution. |
| 81 | + - **Solution**: Java code with comments and explanation. |
| 82 | + - **Complexity**: Time and space complexity analysis. |
| 83 | +4. Click the close button (×) to hide the panel. |
| 84 | + |
| 85 | + |
| 86 | +## Installation |
| 87 | + |
| 88 | +Follow these steps to set up the extension: |
| 89 | + |
| 90 | +1. **Clone or Download the Repository**: |
| 91 | + ```bash |
| 92 | + git clone https://github.com/saksham2882/LeetCode-Learning-Assistant.git |
| 93 | + ``` |
| 94 | + Or download and extract the ZIP file. |
| 95 | + |
| 96 | +2. **Open Extensions Page**: |
| 97 | + - **Chrome**: Go to `chrome://extensions/`. |
| 98 | + - **Edge**: Go to `edge://extensions/`. |
| 99 | + |
| 100 | +3. **Enable Developer Mode**: |
| 101 | + - Toggle "Developer mode" (top-right) to ON. |
| 102 | + |
| 103 | +4. **Load Unpacked Extension**: |
| 104 | + - Click "Load unpacked" and select the `leetcode-learning-assistant` folder. |
| 105 | + |
| 106 | +5. **Set API Key**: |
| 107 | + - Click the extension icon in the browser toolbar. |
| 108 | + - Enter your Gemini API key in the popup and click "Save Key". |
| 109 | + |
| 110 | +6. **Verify Setup**: |
| 111 | + - Visit a LeetCode problem page (e.g., `https://leetcode.com/problems/two-sum/`). |
| 112 | + - Confirm the "Analyze Problem" button appears. |
| 113 | + |
| 114 | + |
| 115 | +## File Structure |
| 116 | + |
| 117 | +``` |
| 118 | +leetcode-assistant/ |
| 119 | +├── background.js # Service worker for Gemini API calls |
| 120 | +├── content_script.js # Injects UI and handles LeetCode page interactions |
| 121 | +├── icons/ # Extension icons |
| 122 | +├── screenshots/ # screenshots |
| 123 | +├── manifest.json # Extension configuration |
| 124 | +├── panel.html # HTML for the assistant panel |
| 125 | +├── popup.html # HTML for the API key settings popup |
| 126 | +├── popup.js # Logic for the popup |
| 127 | +└── styles.css # Styles for the button and panel |
| 128 | +``` |
| 129 | + |
| 130 | +## Technologies Used |
| 131 | + |
| 132 | +| Technology | Description | |
| 133 | +|------------|-------------| |
| 134 | +| **HTML5** | Structures the popup and assistant panel UI. | |
| 135 | +| **CSS3** | Styles the UI with responsive design and animations. | |
| 136 | +| **JavaScript** | Powers the extension’s logic and API communication. | |
| 137 | +| **Gemini 2.5 Flash Model API** | Generates AI-powered hints, approaches, pseudocode, solutions, and complexity analysis. | |
| 138 | +| **Chrome Extension APIs** | Enables storage (`chrome.storage`), messaging (`chrome.runtime`), and tab interactions (`chrome.tabs`). | |
| 139 | + |
| 140 | +## Contributing |
| 141 | + |
| 142 | +We welcome contributions to enhance the LeetCode Learning Assistant! To contribute: |
| 143 | + |
| 144 | +1. **Fork the Repository**: |
| 145 | + ```bash |
| 146 | + git fork https://github.com/saksham2882/LeetCode-Learning-Assistant.git |
| 147 | + ``` |
| 148 | +2. **Create a Feature Branch**: |
| 149 | + ```bash |
| 150 | + git checkout -b feature/your-feature-name |
| 151 | + ``` |
| 152 | +3. **Make Changes**: Implement your feature or bug fix. |
| 153 | +4. **Test Locally**: |
| 154 | + - Load the updated extension in Chrome/Edge via "Load unpacked". |
| 155 | + - Test on multiple LeetCode problems to ensure compatibility. |
| 156 | +5. **Commit and Push**: |
| 157 | + ```bash |
| 158 | + git commit -m "Add your feature description" |
| 159 | + git push origin feature/your-feature-name |
| 160 | + ``` |
| 161 | +6. **Submit a Pull Request**: Open a PR on GitHub with a detailed description of changes. |
| 162 | +7. **Report Issues**: Open an issue for bugs or feature suggestions. |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | +--- |
0 commit comments