From 4fcfd0be6035ac72d16b05e83569ae3f0e3b2344 Mon Sep 17 00:00:00 2001 From: Digvijay Parit <53786395+dvijay96@users.noreply.github.com> Date: Mon, 18 Dec 2023 23:09:24 +0530 Subject: [PATCH] Update 0226-invert-binary-tree.java Removing unnecessary assignment as already parameterized constructor used to do the same. --- java/0226-invert-binary-tree.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/0226-invert-binary-tree.java b/java/0226-invert-binary-tree.java index b19c9bc6a..1ae4a18ad 100644 --- a/java/0226-invert-binary-tree.java +++ b/java/0226-invert-binary-tree.java @@ -4,7 +4,6 @@ public TreeNode invertTree(TreeNode root) { if (root == null) return null; TreeNode node = new TreeNode(root.val); node.right = invertTree(root.left); - node.val = root.val; node.left = invertTree(root.right); return node; }