Submission Detail

77 / 77 test cases passed.
Status:

Accepted

Runtime: 0 ms
Memory Usage: 40.1 MB
Submitted: 0 minutes ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

Sorry. We do not have enough accepted submissions to show distribution chart.

Accepted Solutions Memory Distribution

38250
38500
38750
39000
39250
39500
39750
40000
40250
40500
5
10
15
java
You are here!
Your memory usage beats 65.89 % of java submissions.
Memory (KB)
Distribution (%)

38250
38500
38750
39000
39250
39500
39750
40000
40250
40500
5
10
15
Zoom area by dragging across this chart

Invite friends to challenge Invert Binary Tree


Submitted Code: 0 minutes ago

Language: java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
class Solution {
public TreeNode invertTree(TreeNode root) {
if (root == null)
return root;
TreeNode temp = root.left;
root.left = root.right;
root.right = temp;
invertTree(root.left);
invertTree(root.right);
return root;
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

(40100.00, 10.84)