0 2 3 4 10
Try for this testcase U are getting wrong answer for this case.Figure out where u are going wrong.
Hope this helps.
will you correct my code please?
I have used O(n^2) Approach and considered each element as infected one by one and checked which can be infected by this current infected person.
I saw your code you are making it a bit complex due to which finding mistake is a task ,
You can have a look My Simple solution-Click Here
This is my solution hope it helps