function parseTime(time) {
    const [hours, minutes, milliseconds] = time.split(':').map(Number);
    return { hours, minutes, milliseconds };
}
  
function timeToMilliseconds({ hours, minutes, milliseconds }) {
    return (hours * 60 * 60 * 1000) + (minutes * 60 * 1000) + milliseconds;
}
  
function millisecondsToTime(ms) {
    const totalMinutes = Math.floor(ms / (60 * 1000));
    const hours = Math.floor(totalMinutes / 60);
    const minutes = totalMinutes % 60;
    return { hours, minutes };
}
  
export function sumTimes(times) {
    const totalMilliseconds = times
      .map(parseTime)
      .map(timeToMilliseconds)
      .reduce((acc, ms) => acc + ms, 0);
    return millisecondsToTime(totalMilliseconds);
}
