Problem on Trees and Queries

Revision en1, by _priks, 2022-07-19 12:39:19

Tried implementing normal shortest path algorithm using DFS , construct the string acc to the string C then inserting it into Set data structure which will strong unique strings. I guess this is a kind of brute force approach. Can anyone help me with a optimised one ? ? ? ? ? ? ![ ](Q4)![ ](Q4-test-Case)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English _priks 2022-07-19 12:39:19 467 Initial revision (published)