Coding practice problems
691 coding practice problems with examples, constraints and starter code in C, C++, Java, Python, JavaScript, Go and Rust. Read any problem for free. Sign in to run your code, submit and keep your progress.
- Find Winner on a Tic Tac Toe Game (Easy, Array, Hash Table, Matrix, Simulation)
- Number of Burgers with No Waste of Ingredients (Medium, Math)
- Palindrome Partitioning III (Hard, String, Dynamic Programming)
- Find the Smallest Divisor Given a Threshold (Medium, Array, Binary Search)
- Maximum Side Length of a Square with Sum Less than or Equal to Threshold (Medium, Array, Binary Search, Matrix, Prefix Sum)
- Find N Unique Integers Sum up to Zero (Easy, Array, Math)
- All Elements in Two Binary Search Trees (Medium, Tree, Depth-First Search, Binary Search Tree, Sorting, Binary Tree)
- Minimum Insertion Steps to Make a String Palindrome (Hard, String, Dynamic Programming)
- Convert Integer to the Sum of Two No-Zero Integers (Easy, Math)
- Number of Operations to Make Network Connected (Medium, Depth-First Search, Breadth-First Search, Union Find, Graph)
- Number of Steps to Reduce a Number to Zero (Easy, Math, Bit Manipulation)
- Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold (Medium, Array, Sliding Window)
- Angle Between Hands of a Clock (Medium, Math)
- Jump Game IV (Hard, Array, Hash Table, Breadth-First Search)
- Print Words Vertically (Medium, Array, String, Simulation)
- Delete Leaves With a Given Value (Medium, Tree, Depth-First Search, Binary Tree)
- Minimum Number of Taps to Open to Water a Garden (Hard, Array, Dynamic Programming, Greedy)
- Remove Palindromic Subsequences (Easy, Two Pointers, String)
- Minimum Difficulty of a Job Schedule (Hard, Array, Dynamic Programming)
- Sort Integers by The Number of 1 Bits (Easy, Array, Bit Manipulation, Sorting, Counting)
- Number of Substrings Containing All Three Characters (Medium, Hash Table, String, Sliding Window)
- Count All Valid Pickup and Delivery Options (Hard, Math, Dynamic Programming, Combinatorics)
- Jump Game V (Hard, Array, Dynamic Programming, Sorting)
- Check If N and Its Double Exist (Easy, Array, Hash Table, Two Pointers, Binary Search, Sorting)
- Find the Longest Substring Containing Vowels in Even Counts (Medium, Hash Table, String, Bit Manipulation, Prefix Sum)
- Count Negative Numbers in a Sorted Matrix (Easy, Array, Binary Search, Matrix)
- How Many Numbers Are Smaller Than the Current Number (Easy, Array, Hash Table, Sorting, Counting Sort)
- Rank Teams by Votes (Medium, Array, Hash Table, String, Sorting, Counting)
- Minimum Cost to Make at Least One Valid Path in a Grid (Hard, Array, Breadth-First Search, Graph, Heap (Priority Queue), Matrix, Shortest Path)
- Pizza With 3n Slices (Hard, Array, Dynamic Programming, Greedy, Heap (Priority Queue))
- Generate a String With Characters That Have Odd Counts (Easy, String)
- Lucky Numbers in a Matrix (Easy, Array, Matrix)
- Count Largest Group (Easy, Hash Table, Math)
- Circle and Rectangle Overlapping (Medium, Math, Geometry)
- Construct K Palindrome Strings (Medium, Hash Table, String, Greedy, Counting)
- Longest Happy Prefix (Hard, String, Rolling Hash, String Matching, Hash Function)
- Find Lucky Integer in an Array (Easy, Array, Hash Table, Counting)
- Count Number of Teams (Medium, Array, Dynamic Programming, Binary Indexed Tree, Segment Tree)
- Minimum Value to Get Positive Step by Step Sum (Easy, Array, Prefix Sum)
- Find the Minimum Number of Fibonacci Numbers Whose Sum Is K (Medium, Math, Greedy)
- Restore The Array (Hard, String, Dynamic Programming)
- Minimum Subsequence in Non-Increasing Order (Easy, Array, Greedy, Sorting)
- Number of Steps to Reduce a Number in Binary Representation to One (Medium, String, Bit Manipulation, Simulation)
- Stone Game III (Hard, Array, Math, Dynamic Programming, Game Theory)
- Number of Ways to Paint N × 3 Grid (Hard, Dynamic Programming)
- Kids With the Greatest Number of Candies (Easy, Array)
- Max Difference You Can Get From Changing an Integer (Medium, Math, Greedy)
- Reformat The String (Easy, String)
- Display Table of Food Orders in a Restaurant (Medium, Array, Hash Table, String, Sorting, Ordered Set)
- Minimum Number of Frogs Croaking (Medium, String, Counting)