Second solution: if q is already pointing to the node we want, what is the purpose of p?

while p and q.next:
p = p.next
q = q.next

What is this while loop accomplishing exactly?


Course: Educative: Interactive Courses for Software Developers
Lesson: Educative: Interactive Courses for Software Developers

Hi @Navyashree_Gunjur_Ve, can you please share the course/lesson link here? Thanks!