Edit Distance (Levenshtein Distance)
Implement the classic edit distance algorithm to find the minimum number of single-character edits required to transform one string into another.
Word Break DP
Implement a function to check if a string can be segmented into space-separated dictionary words.
Shortest Common Supersequence
Given two strings, return any shortest supersequence that contains both as subsequences.
Interleaving string
Given three strings s1, s2, and s3, check if s3 is formed by interleaving s1 and s2 while preserving the order of each input string.
Alien Dictionary Order
Given a sorted list of words in an alien language, derive the order of its unique letters.
Open the Lock BFS
Implement a BFS solution to find the minimum number of turns needed to open a 4-wheel lock, avoiding a set of deadends.
Minimum Genetic Mutation
Implement a function to compute the minimum number of single-character mutations needed to transform one gene string into another, using a given bank of valid mutations.
Generate Parentheses
Given n, generate all valid strings of n pairs of parentheses.
Letter Combinations of a Phone Number
Given a string of digits, return all possible letter combinations that the number could represent on a phone keypad.
Word Search Backtrack
Determine if a given word exists in a 2D board by tracing adjacent cells without reusing any cell.
Palindrome Partitioning
Given a string s, return all possible palindrome partitioning of s.
Letter Tile Possibilities
Given a string of letter tiles, count the number of distinct non-empty sequences that can be formed using any non-empty subset in any order.
Partition Labels
Partition a string into maximal parts where each character appears in only one part, returning part lengths.
Character Replacement Window
Given a string and a number k, find the length of the longest substring that can be made uniform by replacing at most k characters.
Permutation in String
Determine if any permutation of a shorter string appears as a contiguous substring in a longer string using an efficient sliding window.
Longest Substring with At Most K Distinct Characters
Given a string and an integer k, find the length of the longest substring that contains at most k distinct characters.
Longest Repeating Character Replacement
Given a string and an integer k, return the length of the longest substring that can be made of identical characters after at most k replacements.
Decode String Stack
Decode a compressed string with repeated substrings like '3[a2[c]]' to 'accaccacc' using a stack-based approach.
Remove K Digits Stack
Remove k digits from a non-negative integer string to produce the smallest possible number using a stack-based approach.
Score of Parentheses
Given a balanced parentheses string, compute its score where () is 1 and concatenation sums, nesting multiplies by 2.
Decode Nested String
Implement a function that decodes a string with nested encoding patterns.
Word Search Matrix
Given a 2D board and a word, determine if the word can be formed by sequentially adjacent cells (horizontally or vertically), without reusing cells.
Regions Cut by Slashes
Given a grid of slashes, count the number of connected regions formed by the slashes and the grid borders.
Extract JSON-like numbers
Parse a simplified JSON-like string without using the json module and sum all numbers found in it.
Showing 25–48 of 51 challenges · medium
Guide: free Python coding challenges
Practice Python by solving problems
PythonSkillset challenges are hands-on coding exercises from beginner to advanced. Open a challenge, read the problem, write Python in the split-pane editor, and run tests with Pyodide — no install required.
How to use the arena
- Pick a category — basics, algorithms, strings, and more
- Open a challenge, read the statement, and edit the starter code
- Run tests, fix failures, then try a related quiz or tutorial lesson
Challenges vs tutorials and quizzes
Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.