Here in that Question we will have to only select the the cities with high per capita income and if dfs possible then try to reach there if no then stop .
Is it give me true result.
Yes you need to find the city with the highest per capita value and then apply dfs on those cities and your answer would the largest connected component
like if
1 and 5 cities connected
but here also 2,3 and 4 are connected with same per capita income then we have to select second one
yes
are u submitted the code
ok
Constant practice, participating in contests will surely help you
or maybe working on your english skills
1 Like
Talent has no language