Skip to main content

Master Coding One Problem at a Time

Join thousands of developers solving algorithmic challenges, preparing for interviews, and building stronger coding skills.

2,500+
Problems
500K+
Developers
50+
Companies

Curated Problems

Hand-picked challenges from top tech companies

Track Progress

Monitor your improvement with detailed analytics

Join Community

Connect with developers worldwide

Problems

Solve coding challenges from top tech companies

Two Sum

Given an array of integers, return indices of two numbers that add up to target.

Arrays Hash Table Easy Google
Solved
85% Success

Valid Parentheses

Determine if the input string has valid parentheses combinations.

Stack String Easy Amazon
Not Started
78% Success

Merge Two Sorted Lists

Merge two sorted linked lists and return as a new sorted list.

Linked List Recursion Easy Microsoft
In Progress
92% Success

Maximum Subarray

Find the contiguous subarray with the largest sum.

Arrays Dynamic Programming Medium Facebook
Not Started
65% Success

Binary Tree Inorder

Return the inorder traversal of a binary tree's node values.

Tree DFS Medium Apple
Solved
73% Success

Longest Palindrome

Find the longest palindromic substring in a given string.

String Dynamic Programming Hard Netflix
Not Started
45% Success

Two Sum

Easy
Arrays Hash Table Google

Description

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

Examples

Example 1:
Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
Example 2:
Input: nums = [3,2,4], target = 6
Output: [1,2]

Constraints

  • • 2 ≤ nums.length ≤ 10⁴
  • • -10⁹ ≤ nums[i] ≤ 10⁹
  • • -10⁹ ≤ target ≤ 10⁹
  • • Only one valid answer exists

Hints

💡 Try using a hash map to store values and their indices
💡 For each element, check if target - element exists in the map
1
2
3
4
5
6
7
8
9
10
11
12
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
hashmap = {}
for i, num in enumerate(nums):
complement = target - num
if complement in hashmap:
return
hashmap[num] = i
return
Runtime: O(n) | Memory: O(n)

Test Results

3/3 passed
✓ Test Case 1 2ms
Input: [2,7,11,15], 9 → Output: [0,1]
✓ Test Case 2 1ms
Input: [3,2,4], 6 → Output: [1,2]
✓ Test Case 3 1ms
Input: [3,3], 6 → Output: [0,1]

Study Plan

Track your progress and stay motivated

Overall Progress

68%
142
Completed
28
In Progress
38
Remaining

This Week's Schedule

Week 12

Arrays & Hashing

Monday - 2 problems

Completed

Two Pointers

Tuesday - 3 problems

In Progress

Sliding Window

Wednesday - 2 problems

Pending

Stack

Thursday - 3 problems

Pending

Binary Search

Friday - 2 problems

Pending
"The expert in anything was once a beginner."
- Helen Hayes

Study Streak

🔥 12

Days in a row

Keep it up! You're on fire!

Weekly Goals

Problems Solved 8/12
Study Hours 6/10
Topics Covered 3/5

Quick Actions

Contests

Compete with developers worldwide

Weekly Contest 372

4 problems • 90 minutes

Starts in
02:45:30
2,847
Registered
$500
Prize Pool

Recent Contests

Weekly Contest 371

Completed • 3,124 participants

Rank: #247
Score: 12/16

Biweekly Contest 118

Completed • 2,856 participants

Rank: #189
Score: 14/16

Weekly Contest 370

Completed • 2,967 participants

Rank: #156
Score: 15/16

Upcoming Schedule

Weekly Contest 373
Sunday, Dec 17 • 10:30 AM EST
Biweekly Contest 119
Saturday, Dec 23 • 8:00 PM EST
Weekly Contest 374
Sunday, Dec 24 • 10:30 AM EST

Global Leaderboard

1
User
CodeMaster_Pro
3,847 points
2
User
AlgoWizard
3,721 points
3
User
ByteNinja
3,654 points
247
You
You
1,892 points

Your Stats

Contests Participated 24
Best Rank #89
Average Rank #247
Problems Solved 67/96
Success Rate 69.8%

Contest Tips

  • Read all problems first
  • Start with easiest problems
  • Test with edge cases
  • Manage your time wisely

Social Feed

See what the community is solving

Your Avatar
User Avatar

CodeMaster_Pro

2 hours ago

Just solved "Longest Palindromic Substring" in O(n) time! The Manacher's algorithm is mind-blowing 🤯

Longest Palindromic Substring
Hard String Amazon
User Avatar

ByteNinja

4 hours ago

Finally cracked the Google interview! Thanks to everyone who helped me prepare. The key was consistent practice on this platform 🚀

Interview Success!
Landed a job at Google
User Avatar

DataStructureGuru

6 hours ago

Working on a challenging Binary Tree problem. Anyone else find level-order traversal tricky at first? 🌳

Binary Tree Level Order Traversal
Medium Tree BFS

My Lists

Organize your coding problems

Array Problems

Essential array manipulation problems

12 problems 8 completed
Arrays Easy Interview Prep
Updated 2 days ago

Dynamic Programming

Master DP with these problems

18 problems 5 completed
Dynamic Programming Hard Google
Updated 1 week ago

Tree & Graph

Data structure fundamentals

15 problems 15 completed
Tree Graph Medium
Completed

System Design

High-level design problems

8 problems 2 completed
System Design Hard Meta
Updated 3 days ago
Profile Picture

John Doe

@johndoe • Software Engineer at Google

San Francisco, CA • Joined March 2023

247
Problems Solved
89
Contest Rank
1,892
Total Points
24
Streak Days

Recent Activity

Solved Two Sum

2 hours ago • Easy • Arrays

Participated in Weekly Contest 372

1 day ago • Rank #156

Created list Dynamic Programming

3 days ago • 18 problems

Problem Progress

Easy 142/180
Medium 89/320
Hard 16/150

Skills

Arrays Advanced
Dynamic Programming Intermediate
Trees Advanced
Graphs Intermediate
Strings Advanced
Math Beginner

Achievements

Problem Solver
Solved 100+ problems
Streak Master
20+ day streak
Contest Participant
Joined 10+ contests

Preferred Languages

Python
65%
JavaScript
25%
Java
10%

Quick Actions

Leaderboard

Top performers in the community

2nd Place

AlgoWizard

3,721 points

2
1st Place

CodeMaster_Pro

3,847 points

1
3rd Place

ByteNinja

3,654 points

3

Rankings

Rank User Points Problems Contests
4
User
DataStructureGuru
Senior Developer
3,542 289 18
5
User
PythonMaster
ML Engineer
3,398 267 15
247
You
You (John Doe)
Software Engineer
1,892 142 8
248
User
JavaExpert
Backend Developer
1,887 141 7
249
User
ReactDev
Frontend Developer
1,876 139 9
250
User
CppCoder
Systems Engineer
1,865 138 6

Your Stats

Current Rank #247
Total Points 1,892
Problems Solved 142
Contest Participations 8
Best Contest Rank #89

Progress to Next Rank

5 points
to reach #246
95% complete

Top Categories

Arrays
85%
Strings
78%
Trees
72%
Graphs
65%

Recent Achievements

100 Problems
2 days ago
Streak Master
1 week ago