You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Solution.go
    path of file: ./repos/awesome-golang-algorithm/leetcode/2101-2200/2187.Minimum-Time-to-Complete-Trips
    
    the code of the file until where you have to start completion: package Solution

import "sort"

func Solution(time []int, totalTrips int) int64 {
	ans := int64(0)
	sort.Ints(time)

	// giao
	minTime, maxTime := int64(1), int64(time[len(time)-1]*totalTrips)
	for minTime <= maxTime {
		midTime := (maxTime-minTime)/2 + minTime
		done := 0
		for i := 0; i < len(time); i++ {
			t := midTime / int64(time[i])
			done += int(t)
			if done >= totalTrips {
				break
			}
		}
		if done >= totalTrips {
			ans = midTime
			maxTime = midTime - 1
		} els
    
func Solution(time []int, totalTrips int) int64 {
	ans := int64(0)
	sort.Ints(time)

	// giao
	minTime, maxTime := int64(1), int64(time[len(time)-1]*totalTrips)
	for minTime <= maxTime {
		midTime := (maxTime-minTime)/2 + minTime
		done := 0
		for i := 0; i < len(time); i++ {
			t := midTime / int64(time[i])
			done += int(t)
			if done >= totalTrips {
				break
			}
		}
		if done >= totalTrips {
			ans = midTime
			maxTime = midTime - 1
		} else {
			minTime = midTime + 1
		}

	}
	/*
		for ; ; ans++ {
			done := 0
			for i := 0; i < len(time); i++ {
				tmp := ans / int64(time[i])
				done += int(tmp)
				if done >= totalTrips {
					return ans
				}
			}
		}
	*/
	return ans
}