Go solution converting to time.Time
Approach\nUsing time package\n\n# Complexity\n- Time complexity: O(1)\n\n# Code\nGo\nfunc numberOfRounds(loginTime string, logoutTime string) int {\n\tlayout :=
# Approach\nUsing time package\n\n# Complexity\n- Time complexity: O(1)\n\n# Code\n```Go\nfunc numberOfRounds(loginTime string, logoutTime string) int {\n\tlayout := "15:04"\n\tparseStart, _ := time.Parse(layout, loginTime)\n\tparseEnd, _ := time.Parse(layout, logoutTime)\n\n\tstart := roundUp(parseStart)\n\tend := parseEnd.Truncate(15 * time.Minute)\n\n\tif parseEnd.Before(parseStart) {\n\t\tend = end.Add(time.Hour * 24)\n\n\t}\n\n\tdiff := end.Sub(start).Minutes() / 15\n\n\tif diff < 0 {\n\t\treturn 0\n\t}\n\n\treturn int(math.Ceil(float64(diff)))\n}\n\nfunc roundUp(input time.Time) time.Time {\n\n\tmins := input.Minute()\n\tremainder := mins % 15\n\n\tif remainder == 0 {\n\t\treturn input\n\t}\n\n\treturn input.Add(time.Duration(15-remainder) * time.Minute)\n}\n```
['Go']