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.
- Minimum Number of Days to Disconnect Island (Hard, Array, Depth-First Search, Breadth-First Search, Matrix, Strongly Connected Component)
- Sum of All Odd Length Subarrays (Easy, Array, Math, Prefix Sum)
- Make Sum Divisible by P (Medium, Array, Hash Table, Prefix Sum)
- Maximum Sum Obtained of Any Permutation (Medium, Array, Greedy, Sorting, Prefix Sum)
- Strange Printer II (Hard, Array, Graph, Topological Sort, Matrix)
- Replace All ?'s to Avoid Consecutive Repeating Characters (Easy, String)
- Min Cost to Connect All Points (Medium, Array, Union Find, Graph, Minimum Spanning Tree)
- Check If String Is Transformable With Substring Sort Operations (Hard, String, Greedy, Sorting)
- Alert Using Same Key-Card Three or More Times in a One Hour Period (Medium, Array, Hash Table, String, Sorting)
- Rearrange Spaces Between Words (Easy, String)
- Crawler Log Folder (Easy, Array, String, Stack)
- Maximum Profit of Operating a Centennial Wheel (Medium, Array, Simulation)
- Coordinate With Maximum Network Quality (Medium, Array, Enumeration)
- Special Array With X Elements Greater Than or Equal X (Easy, Array, Binary Search, Sorting)
- Maximal Network Rank (Medium, Graph)
- Split Two Strings to Make Palindrome (Medium, Two Pointers, String)
- Count Subtrees With Max Distance Between Cities (Hard, Dynamic Programming, Bit Manipulation, Tree, Enumeration, Bitmask)
- Count Substrings That Differ by One Character (Medium, Hash Table, String, Dynamic Programming, Enumeration)
- Largest Substring Between Two Equal Characters (Easy, Hash Table, String)
- Lexicographically Smallest String After Applying Operations (Medium, String, Depth-First Search, Breadth-First Search, Enumeration)
- Slowest Key (Easy, Array, String)
- Distribute Repeating Integers (Hard, Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask)
- Check Array Formation Through Concatenation (Easy, Array, Hash Table)
- Maximum Repeating Substring (Easy, String, Dynamic Programming, String Matching)
- Merge In Between Linked Lists (Medium, Linked List)
- Get Maximum in Generated Array (Easy, Array, Simulation)
- Minimum Deletions to Make Character Frequencies Unique (Medium, Hash Table, String, Greedy, Sorting)
- Minimum Operations to Reduce X to Zero (Medium, Array, Hash Table, Binary Search, Sliding Window, Prefix Sum)
- Determine if Two Strings Are Close (Medium, Hash Table, String, Sorting, Counting)
- Check If Two String Arrays are Equivalent (Easy, Array, String)
- Ways to Make a Fair Array (Medium, Array, Prefix Sum)
- Count the Number of Consistent Strings (Easy, Array, Hash Table, String, Bit Manipulation, Counting)
- Delivering Boxes from Storage to Ports (Hard, Array, Dynamic Programming, Segment Tree, Queue, Heap (Priority Queue), Prefix Sum, Monotonic Queue)
- Max Number of K-Sum Pairs (Medium, Array, Hash Table, Two Pointers, Sorting)
- Number of Students Unable to Eat Lunch (Easy, Array, Stack, Queue, Simulation)
- Average Waiting Time (Medium, Array, Simulation)
- Minimum Adjacent Swaps for K Consecutive Ones (Hard, Array, Greedy, Sliding Window, Prefix Sum)
- Count of Matches in Tournament (Easy, Math, Simulation)
- Partitioning Into Minimum Number Of Deci-Binary Numbers (Medium, String, Greedy)
- Stone Game VII (Medium, Array, Math, Dynamic Programming, Game Theory)
- Reformat Phone Number (Easy, String)
- Maximum Erasure Value (Medium, Array, Hash Table, Sliding Window)
- Jump Game VI (Medium, Array, Dynamic Programming, Queue, Heap (Priority Queue), Monotonic Queue)
- Checking Existence of Edge Length Limited Paths (Hard, Array, Two Pointers, Union Find, Graph, Sorting)
- Maximum Score From Removing Substrings (Medium, String, Stack, Greedy)
- Construct the Lexicographically Largest Valid Sequence (Medium, Array, Backtracking)
- Find Minimum Time to Finish All Jobs (Hard, Array, Dynamic Programming, Backtracking, Bit Manipulation, Bitmask)
- Count Good Meals (Medium, Array, Hash Table)
- Ways to Split Array Into Three Subarrays (Medium, Array, Two Pointers, Binary Search, Prefix Sum)
- Minimum Operations to Make a Subsequence (Hard, Array, Hash Table, Binary Search, Greedy)