AVVST-Editorial

PROBLEM LINK-: CLICK HERE

PROBLEM SETTERS-: @dcpandey

EDITORIALIST-: @dcpandey

DIFFICULTY-: Medium

PREREQUISITES-: Data Structures, Tree

PROBLEM-: Tony Stark daughter Morgan Stark has been kidnapped by Thanos. Avengers are trying to rescue her. The path to reach Morgan is in the form of a tree having N nodes and each node has a value. The tree is rooted at 1. The nodes with prime value might have bombs. Hence Avengers wants to know how many nodes have prime value in the subtree of a certain node(including that node itself). The values of nodes can change while travel. There is Groot near the wall who tells which node is updated to what value. Help Avengers to rescue her if you can.

SOLUTION-: CLICK HERE