Two Sum Problem
Easy • Array • Hash Table
Points:
100
Success Rate:
47.3%
Problem Statement
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
Input Format
nums = [2,7,11,15], target = 9
Output Format
[0,1]
Constraints
- 2 ≤ nums.length ≤ 10⁴
- -10⁹ ≤ nums[i] ≤ 10⁹
- -10⁹ ≤ target ≤ 10⁹
Sample Input/Output
Input: nums = [2,7,11,15], target = 13
Output: [0,2]
Output: [0,2]
Input: nums = [3,2,4], target = 6
Output: [1,2]
Output: [1,2]
Solution.java
Status: Ready
Running test cases...
Correct! Moving to next problem in 3 seconds...
Analysis Dashboard
Your coding journey insights
12
Problems Solved
2h 34m
Total Time
89%
Success Rate
28
Total Attempts
Problem Performance
| Problem | Status | Time | Attempts | Action |
|---|---|---|---|---|
| Two Sum | Solved | 12m 34s | 3 | View |
| Valid Palindrome | Solved | 8m 21s | 1 | View |
| Merge Intervals | Attempted | 45m 12s | 5 | View |