Practice Coding Problems
Improve your skills by solving real coding problems.
Write code, submit, and get instant feedback.
121 practice problems per language · 12 languages
Stock Buy Sell
Find the maximum profit from a single stock buy and sell.
2 days left
n = int(input()) prices = [int(input()) for _ in range(n)] # Find and print the maximum profit
Subscribe to Weekly Practice Problem
Get the latest coding practice problem delivered to your inbox every week.
Select a Language
Python
General-purpose, beginner-friendly language.
121 practice problems »Java
Object-oriented, widely used in enterprise.
121 practice problems »C
Low-level systems programming language.
121 practice problems »C++
Powerful language for performance-critical apps.
121 practice problems »C#
Modern language for .NET and game development.
121 practice problems »PHP
Server-side scripting for web development.
121 practice problems »Kotlin
Modern language for Android and JVM.
121 practice problems »JavaScript
The language of the web. Runs in Node.js.
121 practice problems »TypeScript
Typed JavaScript for larger applications.
121 practice problems »Swift
Apple's language for iOS and macOS apps.
121 practice problems »Rust
Safe, fast systems programming language.
121 practice problems »R
Statistical computing and data analysis.
121 practice problems »How It Works
Each challenge gives you a problem description and starter code in an online editor.
Your program reads input and prints the correct output. When you submit, your code is tested against multiple hidden test cases with different inputs.
Your score is the percentage of tests passed. Pass all tests to earn full XP. Partial credit is given for partially correct solutions.