An AI-powered Chrome extension that provides progressive hints for Data Structures & Algorithms problems, helping students learn problem-solving skills without giving away complete solutions.
- Progressive Hints: Get 3 levels of hints (General Direction โ Data Structure/Algorithm โ Optimization/Edge Cases)
- Side Panel Interface: Clean, modern UI that stays open while solving problems
- Auto-Detection: Automatically detects DSA problems from LeetCode and GeeksforGeeks
- Manual Input: Paste problem statements manually for any DSA problem
- History Tracking: Save and revisit previous queries
- Gemini 1.5 Flash API: Powered by Google's latest AI model for intelligent hint generation
- Google Chrome browser (version 88+)
- Gemini API key from Google AI Studio
-
Download/Clone this repository to your local machine
-
Get API Key:
- Visit Google AI Studio
- Create a new API key
- Copy the key for later use
-
Load Extension:
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the extension folder
- Open Chrome and go to
-
Set API Key:
- Click the extension icon or open the side panel
- Enter your Gemini API key when prompted
- Click "Save & Test API Key"
- The extension will test and save your key securely
For detailed API setup instructions, see API_SETUP.md
dsa-hints-extension/
โโโ manifest.json # Extension configuration
โโโ sidepanel.html # Main UI interface
โโโ sidepanel.css # Styling and animations
โโโ sidepanel.js # Main functionality and UI logic
โโโ config.js # Configuration and API key management
โโโ api-service.js # Gemini API service with error handling
โโโ background.js # Service worker for background tasks
โโโ content.js # Content script for problem detection
โโโ utils/
โ โโโ prompt.js # AI prompt templates and utilities
โโโ icons/ # Extension icons (16x16, 48x48, 128x128)
โโโ .env # Environment variables (create this file)
โโโ .gitignore # Git ignore rules
โโโ API_SETUP.md # Detailed API setup guide
โโโ README.md # This file
- Method 1: Click the extension icon in the toolbar
- Method 2: Right-click on any page โ "Open DSA Hints Coach"
- Method 3: Use keyboard shortcut (if configured)
- Auto-Detection: Visit LeetCode or GeeksforGeeks problem pages
- Manual Input: Paste any DSA problem statement in the textarea
- Click "Get Hint": Receive 3 progressive hints
- Review History: Click on previous queries to reload them
- LeetCode:
leetcode.com/problems/* - GeeksforGeeks:
geeksforgeeks.org/problems/*andgeeksforgeeks.org/practice/*
The extension uses Gemini 1.5 Flash API with the following configuration:
- Temperature: 0.7 (balanced creativity and consistency)
- Max Tokens: 800 (sufficient for detailed hints)
- Model:
gemini-1.5-flash(latest and fastest)
- API Key: Stored securely in Chrome sync storage
- Query History: Last 10 queries stored locally
- Detected Problems: Automatically cached for quick access
- Modify
sidepanel.cssto change colors, fonts, and layout - The extension uses CSS custom properties for easy theming
- Responsive design included for different screen sizes
- Edit
utils/prompt.jsto customize AI behavior - Modify hint categories and generation rules
- Add new prompt templates for different problem types
-
"Failed to generate hints" Error
- Check if your API key is valid and properly saved
- The extension will test your API key when you save it
- Verify you haven't exceeded API usage limits
- Check your internet connection
-
"Invalid API key" Error
- Ensure you've entered the correct Gemini API key
- Check that the key has proper permissions
- Try regenerating the key from Google AI Studio
- Make sure the key starts with "AIza..."
-
"Rate limit exceeded" Error
- You've hit the API usage limit (15 requests per minute)
- Wait a minute and try again
- Consider upgrading your API quota if needed
-
"Network error" Error
- Check your internet connection
- Try refreshing the page
- Check if Google's servers are accessible
-
Side Panel Not Opening
- Check if the extension is properly loaded
- Try refreshing the page
- Ensure Chrome version supports side panels (88+)
-
Problem Detection Not Working
- Verify you're on a supported website (LeetCode, GeeksforGeeks)
- Check if content scripts are enabled
- Try refreshing the page
- Open Chrome DevTools
- Check the Console tab for error messages
- Look for messages from "DSA Hints Coach"
- Gamification: Track hint usage and provide achievements
- Problem Categories: Organize problems by difficulty and topic
- Custom Hints: Allow users to create and share hint sets
- Code Analysis: Analyze user code and provide specific feedback
- Learning Paths: Suggest related problems and concepts
- Offline Mode: Cache hints for offline access
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
- Google AI Studio for providing the Gemini API
- Chrome Extensions Team for the side panel API
- DSA Community for inspiration and feedback
If you encounter any issues or have suggestions:
- Open an issue on GitHub
- Check the troubleshooting section above
- Ensure you're using the latest version
Happy Coding! ๐
Remember: The goal is to learn, not just to solve. Use hints wisely and understand the concepts behind each approach.