I have an array like below
[
{"st":"10:30,22:30","day":1},
{"st":"9:30,20:30","day":3},
{"st":"9:30,20:30","day":4},
{"st":"11:0,23:30","day":7},
{"st":"11:0,23:30","day":6},
{"st":"8:0,23:0","day":2},
{"st":"8:0,23:0","day":5}
]
I want to convert it like below
[
{"st":"10:30,22:30","day":[1]},
{"st":"9:30,20:30","day":[3,4]},
{"st":"11:0,23:30","day":[7,6]},
{"st":"8:0,23:0","day":[2,5]}
]
Based on the duplicate "st" values i want to merge those corresponding days. i was tried so many methods but i was unable to do. can anybody please help me out. Thanks in advance.