DOUBT in a LL ques@ 02:23:53

Sir,
while finding the kth element from the last in a given linked list why can’t we reverse the linked list ?

Hello @aaliyah_beg if you will reverse the whole array then your code is not optimsed.
because your code is taking extra time to reverse the linked list.
that will take the very much time.
but there is one more approach in which you can find the same by doing the two pointer and it is the optimised one much more optimised.
if you have any other doubt you can ask here:
Happy Learning!!
Happy Learning!!