We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 24b00d8 + fc65849 commit 326a8d8Copy full SHA for 326a8d8
invert-binary-tree/s0ooo0k.java
@@ -0,0 +1,14 @@
1
+class Solution {
2
+ public TreeNode invertTree(TreeNode root) {
3
+ if(root==null) return null;
4
+
5
+ TreeNode left = invertTree(root.left);
6
+ TreeNode right = invertTree(root.right);
7
8
+ root.left=right;
9
+ root.right=left;
10
11
+ return root;
12
+ }
13
+}
14
jump-game/s0ooo0k.java
@@ -0,0 +1,15 @@
+ public boolean canJump(int[] nums) {
+ int n = nums.length;
+ int maxJump=0;
+ for(int i=0; i<n; i++) {
+ if(i>maxJump) return false;
+ else {
+ maxJump = Math.max(maxJump, i+nums[i]);
+ return true;
15
0 commit comments