Bitwise Tree - An interesting Problem
Difference between en1 and en2, changed 4 character(s)
Given a Tree of n vertices numbered from 1 to n. Each edge is associated with some weight given by array _tree_weight_. There are _q queries_ in the form of a 2-D array, queries, where each element consist of two integers (_say, u and v_). For each query, compute the sum of **bitwise XOR, the bitwise AND, and the bitwise OR** of the weights of the edges on the path from u->v. Return the answer to each query as an array of integers.↵
Refer to the image for Sample Test cases.↵

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English dewansarthak1601 2022-08-10 19:55:37 124
en4 English dewansarthak1601 2022-08-10 19:52:27 103 Tiny change: 'br>\nn = 3\ntree_fro' -> 'br>\nn = 3 <br>\ntree_fro'
en3 English dewansarthak1601 2022-08-10 19:51:02 496
en2 English dewansarthak1601 2022-08-10 19:43:32 4 Tiny change: 'integers (_say, u and v_). For eac' -> 'integers (say, u and v). For eac'
en1 English dewansarthak1601 2022-08-10 19:43:06 517 Initial revision (published)