input: Write a python function to detect a loop in a linked list.
  assert detect_loop([1, 2, 3, 4, 5]) == False
  assert detect_loop([1, 2, 3, 4, 5, 2]) == True
  assert detect_loop([]) == False
output: class ListNode:
      def __init__(self, value=0, next=None):
          self.value = value
          self.next = next
  
  def detect_loop(values):
      if not values:
          return False
      
      # Create the linked list from the list of values
      head = ListNode(values[0])
      current = head
      nodes = {head: 0}  # Keep track of nodes and their positions
      loop_start = None
      
      for i in range(1, len(values)):
          node = ListNode(values[i])
          current.next = node
          current = node
          
          # Check if this node's value is in the nodes dictionary
          if node.value in nodes and loop_start is None:
              loop_start = node.value
          
          nodes[node] = i
      
      # If there's no potential loop start, return False
      if loop_start is None:
          return False
      
      # Now, create the loop if necessary
      current = head
      while current.next:
          if current.value == loop_start:
              loop_entry_node = current
          current = current.next
      
      if current.value == loop_start:
          current.next = loop_entry_node
      
      # Detect loop using Floyd's Cycle-Finding Algorithm
      slow = head
      fast = head
      
      while fast and fast.next:
          slow = slow.next
          fast = fast.next.next
          if slow == fast:
              return True
      
      return False