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 the Highest Altitude (Easy, Array, Prefix Sum)
- Decode XORed Array (Easy, Array, Bit Manipulation)
- Minimize Hamming Distance After Swap Operations (Medium, Array, Depth-First Search, Union Find)
- Number Of Rectangles That Can Form The Largest Square (Easy, Array)
- Maximum Number of Balls in a Box (Easy, Hash Table, Math, Counting)
- Sum of Unique Elements (Easy, Array, Hash Table, Counting)
- Maximum Absolute Sum of Any Subarray (Medium, Array, Dynamic Programming)
- Minimum Length of String After Deleting Similar Ends (Medium, Two Pointers, String)
- Change Minimum Characters to Satisfy One of Three Conditions (Medium, Hash Table, String, Counting, Prefix Sum)
- Palindrome Partitioning IV (Hard, String, Dynamic Programming)
- Can You Eat Your Favorite Candy on Your Favorite Day? (Medium, Array, Prefix Sum)
- Longest Nice Substring (Easy, Hash Table, String, Divide and Conquer, Bit Manipulation, Sliding Window)
- Form Array by Concatenating Subarrays of Another Array (Medium, Array, Two Pointers, Greedy, String Matching)
- Check if Array Is Sorted and Rotated (Easy, Array)
- Maximum Score From Removing Stones (Medium, Math, Greedy, Heap (Priority Queue))
- Largest Merge Of Two Strings (Medium, Two Pointers, String, Greedy)
- Minimum Changes To Make Alternating Binary String (Easy, String)
- Count Number of Homogenous Substrings (Medium, Math, String)
- Minimum Degree of a Connected Trio in a Graph (Hard, Graph, Enumeration)
- Find Nearest Point That Has the Same X or Y Coordinate (Easy, Array)
- Check if Number is a Sum of Powers of Three (Medium, Math)
- Sum of Beauty of All Substrings (Medium, Hash Table, String, Counting)
- Merge Strings Alternately (Easy, Two Pointers, String)
- Minimum Number of Operations to Move All Balls to Each Box (Medium, Array, String, Prefix Sum)
- Maximum Score from Performing Multiplication Operations (Hard, Array, Dynamic Programming)
- Count Items Matching a Rule (Easy, Array, String)
- Equal Sum Arrays With Minimum Number of Operations (Medium, Array, Hash Table, Greedy, Counting)
- Car Fleet II (Hard, Array, Math, Stack, Heap (Priority Queue), Monotonic Stack)
- Second Largest Digit in a String (Easy, Hash Table, String)
- Check if Binary String Has at Most One Segment of Ones (Easy, String)
- Minimum Elements to Add to Form a Given Sum (Medium, Array, Greedy)
- Check if One String Swap Can Make Strings Equal (Easy, Hash Table, String, Counting)
- Find Center of Star Graph (Easy, Graph)
- Determine Color of a Chessboard Square (Easy, Math, String)
- Sentence Similarity III (Medium, Array, Two Pointers, String)
- Count Nice Pairs in an Array (Medium, Array, Hash Table, Math, Counting)
- Maximum Ascending Subarray Sum (Easy, Array)
- Number of Orders in the Backlog (Medium, Array, Heap (Priority Queue), Simulation)
- Maximum Value at a Given Index in a Bounded Array (Medium, Math, Binary Search, Greedy)
- Maximum Number of Consecutive Values You Can Make (Medium, Array, Greedy, Sorting)
- Minimum Number of Operations to Reinitialize a Permutation (Medium, Array, Math, Simulation)