I have a time array I want to group by on another key value having start time and end time using typescript

Time_Array = ["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00"]

Input = [
{
“hour”: “00:00”,
“gID”: 10
},
{
“hour”: “01:00”,
“gID”: 10
},{
“hour”: “02:00”,
“gID”: 10
},{
“hour”: “07:00”,
“gID”: 30
},{
“hour”: “08:00”,
“gID”: 32
},{
“hour”: “11:00”,
“gID”: 40
},{
“hour”: “12:00”,
“gID”: 40
},{
“hour”: “15:00”,
“gID”: 55
},
{
“hour”: “17:00”,
“gID”: 59
},
]

Expected_Output = [{“start_time” : “00:00”, “end_time”:”03:00″, “gID”:10},{“start_time” : “07:00”, “end_time”:”08:00″, “gID”:30},{“start_time” : “08:00”, “end_time”:”09:00″, “gID”:32}
{“start_time” : “11:00”, “end_time”:”13:00″, “gID”:40},{“start_time” : “15:00”, “end_time”:”16:00″, “gID”:55},{“start_time” : “17:00”, “end_time”:”18:00″, “gID”:59}]