Perf -5 test failing module 2

Can anyone help me with this test case ?
This is the only case which is failing

4 Likes

same query!! Its the only case which is failing

Hey @deepadeshra, I had a long look at your code and found two issues in it.

  • You are using the brute force approach (hashmap) to detect the loop in Linked List, Try to do this more optimally(Refer Milestones to learn the optimal approach).
  • You don’t need to create new nodes every time while creating odd and even lists(Memory wastage) can you use the existing nodes of given list and build your odd and even lists?
1 Like

I think my code is not having any of the both issues described above but perf-test-case-5 is failing… Is there anything else to consider?

Sir but my code is not having any of these issues ,what is the reason its still failing

@vaibhav98 @mahendra @deepadeshra Consider the case when m > N Where m is the cycle start index and N is the number of elements in the given singly linked list.


when passing m >n
eg 5 15
1 2 3 4 5
It says points out error in listnode.py …should i edit it?

Like for this input
5 15
1 2 3 4 5
op is :

3
1 3 5
2
2 4

is it true or false ?

yeah it should be like that…but it is giving the above error

yes, i don’t think this case should be there, as we have nothing to deal with m, we only get the head of list to solve this problem.

yeah ,the only way we can deal with this editing the other files

I am facing the same issue while running this test case.
And why is it showing this :- python: not found

Hi Everyone, We have updated the testcases. Please resubmit your codes and test whether they are working now @deepadeshra @vaibhav98 @mahendra @shubhamkumar27

Thanks Now it is working fine…

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.

Closing this topic as your issue is resolved by the mentor. If it is still not resolved, Kindly un-mark the accepted solution or create a new topic and post this question as a reference link in the description of the new topic.