How it works. What you do.
Set it up once. Let it run quietly in the background during your coding interview. No distractions. Just results.
Get Started
Login to Ezzi
Create an account and login to Ezzi. Get instant access to our AI-powered interview solution generator.
Log in to Ezzi

Capture the Problem
Start taking screenshots
Capture the coding problem with a simple keyboard shortcut. Up to 2 screenshots will be saved and shown on the application.See keyboard shortcuts section below for details.
Solve
Get your solutions
Once you've captured your screenshots, trigger solution generation with a keyboard shortcut. We'll analyze the problem and provide a solution with detailed explanations including complexity analysis.
Thoughts (Read these aloud)
- We need to find two numbers that sum to the target value.
- We can use two nested loops to check all possible pairs.
- For each number, we'll check if it sums with any other number to reach the target.
Solution
Solution
1function twoSum(nums, target) {
2 // Check all possible pairs of numbers
3 for (let i = 0; i < nums.length; i++) {
4 for (let j = i + 1; j < nums.length; j++) {
5 // If we find a pair that sums to target
6 if (nums[i] + nums[j] === target) {
7 return [i, j];
8 }
9 }
10 }
11 // No solution found
12 return [];
13}
Complexity
- Time Complexity: O(n²)
- Space Complexity: O(1)
What I Changed (Read these aloud)
- The current solution uses nested loops, resulting in O(n²) time complexity.
- We can optimize this by using a hash map to store previously seen numbers.
- This reduces time complexity to O(n) with O(n) space trade-off.
- The hash map lets us find complements in constant time O(1).
Solution
Solution
1function twoSum(nums, target) {
2 // Value -> Index mapping
3 const seen = {};
4
5 for (let i = 0; i < nums.length; i++) {
6 const complement = target - nums[i];
7 // Check if we've seen the complement before
8 if (complement in seen) {
9 return [seen[complement], i];
10 }
11 // Store current number and its index
12 seen[nums[i]] = i;
13 }
14 // No solution found
15 return [];
16}
Complexity
- Time Complexity: O(n) - single pass through the array
- Space Complexity: O(n) - storing up to n elements in hash map
- Trade-off: Using more space to achieve better time complexity
Debug
Debug your solutions
Need optimization? Capture additional screenshots of your code and generate an improved solution. We'll debug and optimize your code with before and after comparisons, explaining the improvements.
Keyboard Shortcuts
Quick access to all Ezzi features
Command |
---|
Hide/Show Window Quickly toggle the visibility of the Ezzi window Command+B |
Take Screenshot Capture the current screen to analyze code or problems Command+H |
Move Window Reposition the Ezzi window anywhere on screen Command+↑ ↓ ← → |
Generate Solution Generate a solution for the current problem Command+Return |
Debug Generate optimized solutions with performance improvements and detailed explanations of changes Command+Return |
Reset Context Clear the current conversation and start fresh Command+G |
Language Support
Ezzi works with these programming languages