BlackRock interview question

write a program to find loops in linked list. its complexity. write compilable code.