Find separation values from a starting node

后端 未结 3 1680
长情又很酷
长情又很酷 2021-01-28 03:11

I found on some online coding exercises and this one looks really cool and I wanted to give it a shot.

Problem Statement

Quinn is a pretty popul

3条回答
  •  鱼传尺愫
    2021-01-28 03:44

    If i had to solve this problem,

    First I would create an array and initialise it with student who are 1 with Quinn by finding rows (elements) studentX ←→ Quinn in original array.

    Then I would search recursively those who are level n with quinn by finding rows studentX ←→ student(n-1)FromQuinn

提交回复
热议问题