HF RL Explorer

Detecting Consecutive Integers in a List

Detecting Consecutive Integers in a List: a task in Terminal-Lego-15k (Harbor dataset). Write a Python script that detects consecutive integers in a list and outputs them as ranges. Given a sorted list of integers, the program should identify sequences of consecutive numbers and format them as…

The task

Write a Python script that detects consecutive integers in a list and outputs them as ranges. Given a sorted list of integers, the program should identify sequences of consecutive numbers and format them as ranges.

Part of PrimeIntellect/Terminal-Lego-15k.