Watch your own
code run.
Step through algorithms or debug a broken service in your browser, with no account needed to start.
1class Solution:
2 def levelOrder(self, root) -> list[list[int]]:
3 if root is None:
4 return []
5
6 from collections import deque
7
8 result = []
9 queue = deque([root])
10
11 while queue:
12 level_size = len(queue)
13 level = []
14 for _ in range(level_size):
15 node = queue.popleft()
16 level.append(node.val)
17 if node.left:
18 queue.append(node.left)
19 if node.right:
20 queue.append(node.right)
21 result.append(level)
22
23 return result
Algorithms
Learn each approach well enough to write it yourself. Each problem has a lesson that asks you to work out every step before it shows you.
Then you write the code, and the visualizer steps through what you wrote, in Python, JavaScript, TypeScript, Java, C++ or C#.
Projects
Some coding interviews now include a round where you debug an unfamiliar service from a terminal. You can practice one here, before it counts.
Each incident is a small service with a real bug, running in your browser tab, untimed and with no account.
Price
Pro
$12 / month
Everything in Free, plus:
- Trace video exports
- Cloud judging
- Cloud drafts across devices