class RuboCop::Cop::Lint::DuplicateRegexpCharacterClassElement

def each_repeated_character_class_element_loc(node)

rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def each_repeated_character_class_element_loc(node)
  node.parsed_tree&.each_expression do |expr|
    next if skip_expression?(expr)
    seen = Set.new
    enum = expr.expressions.to_enum
    expression_count = expr.expressions.count
    expression_count.times do |current_number|
      current_child = enum.next
      next if within_interpolation?(node, current_child)
      current_child_source = current_child.to_s
      next_child = enum.peek if current_number + 1 < expression_count
      if seen.include?(current_child_source)
        next if start_with_escaped_zero_number?(current_child_source, next_child.to_s)
        yield current_child.expression
      end
      seen << current_child_source
    end
  end
end