Leetcode Problem

problem link >


my code>

After reading the problem consult this >>
my problem is to consider a scenario
task 1 has prerequisite 2
task 1 also have prerequisite 0
so topo sort would be like
2 0 1 ORR 0 2 1
Now if someone ask is task 2 prerequisite of 0
now topo. sort will return different answers in these 2 scenarios while both topo. sorting are correct but will generate different answers like true in 2 0 1 and false in 0 2 1 so how to deal with this case ???

hello @joshisanjay8467

top sort only ensures that the all prequesites will be covered first before the current course . u cannot extract any other information from this order.
2 0 1
for example here u are at 1 then u can surely say that if there is any prequesite for it then it will be covred before 1 but u cant say that whaterever courses covered before it(1) are the prequesites of 1. (they may be or may not) .

u have to figure out some alternative approach to solve this problem

okay bhaiya will figure out something else

bhaiya I did this ques using topological sorting but can u help me to find time complexity of my code it is O(V+E)*V !! am i right or not?
my code https://ide.codingblocks.com/s/487799

log factor will also be theere because set insertion will taake log(v)

okay bhaiya got that means O(V+E)VlogV


:+1:




bhaiya I am being offered BTA profile role in ZS associate 8lpa should I take it considering I have interest in coding ?

bro ye BTA kya hai?
atleast i will not recommend to take any non tech job if u have interset in coding.
just keep trying for other companies u can surely crack a decent offer from decent company with decent pay(lot more than 8lpa ).

also if im not wrong that 8lpa is ctc right?

BTA means business technology analyst nd yes it is CTC . Being 3rd tier college student 8lpa sounds good but even I am reluctant to take it bcz my clg allows only one placement then only for package 2 times of current CTC and having interest in coding even I don’t want to take it, but that worst case scenario scares me but amazon , aws, commvault,josh will also be coming

one placement policy :grimacing: , bro in my opinion u should appear for other tech companies that u have mentioned they are much better than this (in terms of pay , job profile ,work culture and reputation)

yes bhaiya . Bhaiya one more thing since I applied on 30’s of product based companies via their career page but none of them responses back what to do for off campus selection?

[quote=“joshisanjay8467, post:12, topic:157336, full:true”]
yes bhaiya . Bhaiya one more thing since I applied on 30’s of product based companies via their career page but none of them responses back what to do for off campus selection?
[/quote].

apply thorugh employee referall, hardly anyone get response through careers page.

for that I guess only linkedin is possible

yes…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.