Medium Coding Problems
Practice 71 medium coding problems on Code Arena — each with a live judge, worked examples, and a solution editorial.
- Greatest Common Divisor — Medium · Math, Number Theory
- Primality Test — Medium · Number Theory, Math
- Maximum Subarray Sum — Medium · Dynamic Programming, Arrays
- Balanced Brackets — Medium · Stack, Strings
- Nth Fibonacci — Medium · Dynamic Programming, Math
- Second Largest — Medium · Arrays
- Count Primes — Medium · Number Theory
- Palindrome Check — Medium · Strings
- Anagram Check — Medium · Strings, Sorting
- GCD of an Array — Medium · Math, Number Theory
- Binary to Decimal — Medium · Math, Strings
- Decimal to Binary — Medium · Math
- Modular Exponentiation — Medium · Math, Number Theory
- Sum of Divisors — Medium · Math, Number Theory
- Count Set Bits — Medium · Math, Bit Manipulation
- Reverse Integer — Medium · Math
- Two Sum Exists — Medium · Arrays, Hashing
- Missing Number — Medium · Arrays, Math
- Kth Largest Element — Medium · Sorting, Arrays
- Most Frequent Element — Medium · Hashing, Arrays
- Single Number — Medium · Bit Manipulation, Arrays
- Majority Element — Medium · Arrays, Algorithms
- Roman to Integer — Medium · Strings, Implementation
- Valid Palindrome — Medium · Strings, Two Pointers
- Search Insert Position — Medium · Binary Search, Arrays
- Climbing Stairs — Medium · Dynamic Programming
- Valid Parentheses — Medium · Stack, Strings
- Most Common Word — Medium · Hashing, Strings
- Parse a Timestamp — Medium · Strings, Implementation
- Format a Video Length — Medium · Math, Implementation
- Cash Register Change — Medium · Greedy, Math
- Caesar Cipher — Medium · Strings, Implementation
- Run-Length Encoding — Medium · Strings
- Credit Card Validation — Medium · Math, Implementation
- Leaderboard Ranking — Medium · Sorting
- Transpose a Grid — Medium · Arrays, Implementation
- Shopping on a Budget — Medium · Greedy, Sorting
- Double-Booked? — Medium · Sorting, Greedy
- IP Address to Integer — Medium · Strings, Math
- Grade Distribution — Medium · Arrays
- Longest Win Streak — Medium · Strings
- Sum a Spreadsheet Column — Medium · Strings, Implementation
- Maximum Nesting Depth — Medium · Stack, Strings
- URL Slug — Medium · Strings, Implementation
- Overtime Pay — Medium · Math, Implementation
- Split the Bill — Medium · Math
- Median Value — Medium · Sorting, Arrays
- Most Common Value — Medium · Arrays, Hashing
- Shift Duration — Medium · Implementation, Math
- Election Winner — Medium · Strings, Hashing
- Password Strength — Medium · Strings, Implementation
- Collatz Steps — Medium · Math, Implementation
- Count Pairs with Sum — Medium · Arrays, Hashing
- Longest Equal Run — Medium · Arrays
- Rotate Array Right — Medium · Arrays, Implementation
- Heaviest Row — Medium · Matrix, Arrays
- Count Anagram Groups — Medium · Strings, Hashing, Sorting
- Two Sum (Sorted) — Medium · Two Pointers, Arrays
- Binary Search — Medium · Binary Search
- Maximum Window Sum — Medium · Sliding Window, Arrays
- Count Distinct (Sorted) — Medium · Two Pointers, Arrays
- Next Greater Element — Medium · Stack, Arrays
- Run-Length Decode — Medium · Strings, Implementation
- Count Pairs With Difference — Medium · Hashing, Arrays
- Subarray With Target Sum — Medium · Sliding Window, Two Pointers, Prefix Sum
- Rotate Matrix 90° — Medium · Matrix, Implementation
- Spiral Order — Medium · Matrix, Implementation
- Pascal's Triangle Row — Medium · Combinatorics, Math
- Power of Two — Medium · Bit Manipulation, Math
- Longest Substring Without Repeats — Medium · Sliding Window, Hashing, Strings
- LCM of Array — Medium · Number Theory, Math