Company: HSBC oncampus_5april
Difficulty: medium
Problem Description A mouse is digging in the roots of a plant in search of food. The plant root nodes are represented by integers, and the mouse digs through the roots in a Breadth-First Search (BFS) manner: it visits the root first, then every node on the next level from left to right, then the level after that, and so on. All nodes contain food except the nodes whose value is a prime number. When the mouse encounters a node with a prime value, it skips that node and continues its search. The children of a skipped node are still searched in their normal BFS position. (inferred - the source says the mouse "skips that node and continues its search" and does not show a sample output; the skip applies to that node only, not to the nodes below it.) A prime number is an integer greater than 1 whose only positive divisors are 1 and itself. In particular, 1 is not prime, so a node with value 1 contains food. Return the values of the nodes where the mouse finds food, in the order the mouse vi