Press βΆ Run Code or hit Ctrl + Enter to execute.
Supports standard output, errors, input prompts, and syntax errors.Practice competitive programming and technical interview problems with instant test suite feedback, edge case validation, and clean starter templates.
Run code immediately in your browser with zero downloads, installation, or environment setup.
Full support for interactive scanners, terminal arguments, and multi-line user inputs.
Get instant What β’ Why β’ How error explanations and auto-apply fixes directly into your editor.
Generate instant shareable URLs to collaborate with teammates, classmates, or instructors.
Join thousands of developers mastering full-stack engineering with our distraction-free, 3-minute concept lessons and hands-on projects.
Step-by-step visual explanations for Big-O analysis, HashMaps, Trees, Graphs, and Dynamic Programming.
def two_sum(nums, target):
seen = {}
for i, num in enumerate(nums):
diff = target - num
if diff in seen:
return [seen[diff], i]
seen[num] = i
return []
print("Indices:", two_sum([2, 7, 11, 15], 9))Yes! Use the editor to add test assertions or supply custom inputs via the Stdin drawer.