Validate Hex Color Code
Write a function that validates hex color codes using regular expressions.
Multiline anchor match
Extract lines beginning with a plain-text prefix from multiline strings using Python's re module.
Match Balanced Parentheses with Regex
Write a function that uses regular expressions to determine if parentheses are balanced and properly nested.
Compress Bits Run
Write a function that compresses a binary string by representing consecutive identical bits as a count-bit pair.
Levenshtein Distance
Implement the classic Levenshtein distance algorithm to measure string similarity.
Longest Common Subsequence
Given two strings, compute the length of the longest subsequence common to both.
Longest Palindromic Subsequence
Compute the length of the longest palindromic subsequence in a given string.
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.
Palindrome Partitioning Minimum Cuts
Given a string, return the minimum number of cuts needed such that every substring in the partition is a palindrome.
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.
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.
Generate Parentheses
Given n, generate all valid strings of n pairs of parentheses.
Word Search Backtrack
Determine if a given word exists in a 2D board by tracing adjacent cells without reusing any cell.
Remove invalid parentheses
Given a string with parentheses and letters, return all valid strings after removing the minimum number of invalid parentheses.
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.
Longest Substring Without Repeating Characters
Implement a function that returns the length of the longest substring without repeating characters.
Minimum Window Substring
Implement a sliding window algorithm to find the minimum window substring containing all characters of a given pattern.
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.
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.
Minimum Window Subsequence
Given strings s and t, return the minimum window substring of s that contains t as a subsequence, or empty string if none exists.
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.
Showing 121–144 of 162 challenges
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.