Pergunta de entrevista da empresa JUSPAY

Question 3 based on tree and graph difficult