Timedout in module 8

Though I am implementing the approach they have done in the video,but still it is showing TLE(Timeout)

In your code sample you tried to check curr.next.val % 2 == 1 before you checked if curr.next == null which in certain cases can cause errors because there is no next node.

Also you had written curr.next.val == 1 instead of curr.next.val % 2 == 1 .Seems like a typo to me. Do fix it . Good luck

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.