The interviewer directly reached through some channel,
Supposed to have 3 rounds
Got Rejected in first round itself
Gave the sort a copy array and HashMap based solution
ran through given test successful
Remove all subtrees where all node values are 0
public static TreeNode remove(TreeNode root) {
if (root == null) return null;
root.left = remove(root.left);
root.right = remove(root.right);
if (root.val == 0 && root.left == null && root.right == null) {
return null;
}
return root;}
the interviewer was satisfied
Verdict: Rejected
Rant: WhyTF these interviewers want everything perfect seemless, I even dont know what i did wrong, If this continue i ll leave all ethics and will use AI and just push the most optimzed solution in first place itself.