Tip 1: Practice at least 250 questions.
Tip 2: For example, do at least 2 projects.
Tip 1:Have some projects on your resume.
Tip 2: Do not put false information on your resume.



1. A binary tree is a tree in which each node has at most two children.
2. The given tree will be non-empty.
3. The given tree can have multiple nodes with the same value.
4. If there are no nodes in the tree which are at distance = K from the given node, return an empty list.
5. You can return the list of values of valid nodes in any order. For example if the valid nodes have values 1,2,3, then you can return {1,2,3} or {3,1,2} etc.

Consider this tree above. The target node is 5 and K = 3. The nodes at distance 1 from node 5 are {2}, nodes at distance 2 from node 5 are {1, 4} and nodes at distance 3 from node 5 are {6, 3}.
You are given an arbitrary binary tree, a node of the tree, and an integer 'K'. You need to find all such nodes which have a distance K from the given node and return the list of these nodes.
Distance between two nodes in a binary tree is defined as the number of connections/edges in the path between the two nodes

Consider the following binary search tree so the evaluation of the expression is ( 4 * ( 5 - ( 2+ 7 ) ) ) = ‘-16’
You have been given the root of the tree.
Given a numeric string ‘STR’ which is a string containing numeric characters from ‘0’ to ‘9’, you have to encrypt the string by changing each numeric character as shown below:
‘0’ -> ‘9’
‘1’ -> ‘8’
‘2’ -> ‘7’ and so on till ‘9’ -> ‘0’



Order of return of diagonal path’s array/vector: The rightmost diagonal path must come first, and so on.
Every parent node comes first then the child node. In other words, return the diagonal element from top to bottom.
Consider the given binary tree.

There are 4 diagonal paths:
1 3 6
2 5 9
4 8
7
You need to return ‘1 3 6 2 5 9 4 8 7’.
Let's consider this example

Diagonal paths are:
1 3 6
2 5
4
You need to return ‘1 3 6 2 5 4’.
You have been given a binary tree of integers. You are supposed to find the diagonal traversal(refer to Example) of the given binary tree.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
To make an AI less repetitive in a long paragraph, you should increase: