https://practice.geeksforgeeks.org/problems/circular-linked-list/1

bool isCircular(Node *head) {
  if (head == nullptr) {
    return true;
  }

  Node *curr = head->next;

  while (curr != nullptr) {
    if (curr == head) {
      return true;
    }
    curr = curr->next;
  }

  return false;
}