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.
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.
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.
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.
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.
Base64 Encode/Decode
Implement two functions to encode and decode Base64 strings using the standard alphabet and padding.
Base64 Encode Decode
Implement Base64 encoding and decoding functions that handle padding and all standard characters.
Showing 25–37 of 37 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.