Tip 1: Practice At least 300 questions.
Tip 2: Build a Resume according to the Job Description.
Tip 3: Working with Big Data/Distributed Systems is a plus.
Tip 1: Include skills relevant to the job description.
Tip 2: Do not include false information on your resume; ensure you have in-depth knowledge of everything listed.


1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.



For the given input array [1, 1, 3],
1 can be represented as the sum of elements of the subset [1],
2 can be represented as the sum of elements of a subset [1, 1],
3 can be represented as the sum of elements of a subset [3],
4 can be represented as the sum of elements of a subset [1, 3],
5 can be represented as the sum of elements of a subset [1, 1, 3]
So, the smallest positive integer value that cannot be represented as a sum of elements of any subset of a given array is 6.



The traversal should proceed from left to right according to the input adjacency list.
Adjacency list: { {1,2,3},{4}, {5}, {},{},{}}
The interpretation of this adjacency list is as follows:
Vertex 0 has directed edges towards vertices 1, 2, and 3.
Vertex 1 has a directed edge towards vertex 4.
Vertex 2 has a directed edge towards vertex 5.
Vertices 3, 4, and 5 have no outgoing edges.
We can also see this in the diagram below.
BFS traversal: 0 1 2 3 4 5


Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?