Description
I noticed that the current loop detection algorithm in the LinkedList class is not efficient for large lists. I would like to suggest an improvement to make it more optimized. Easiest Code for the ones who is new for a coding and very easy to understand.
also added one more function if loop is detect it will remove loop and return.
Steps to reproduce
1.Create a linked list with a loop.
2.Run the loop detection algorithm.
3.Gives Error
Excepted behavior
I expected the loop detection algorithm to run efficiently and quickly identify the loop in the linked list and also need to have option to remove loop.
Screenshots

Additional context
No response