func concat(digits []int, repeatingDigitIndex int) string {
	var buffer bytes.Buffer
	for i := 0; i < repeatingDigitIndex; i++ {
		buffer.WriteString(strconv.Itoa(digits[i]))
	}

	// If the repeating result is a 0, return
	if repeatingDigitIndex == len(digits)-1 && digits[repeatingDigitIndex] == 0 {
		return buffer.String()
	}

	// Collect repeating digits between paranthesis
	buffer.WriteString(leftParenthesis)
	for i := repeatingDigitIndex; i < len(digits); i++ {
		buffer.WriteString(strconv.Itoa(digits[i]))
	}
	buffer.WriteString(rightParenthesis)
	return buffer.String()
}
// concat create the string result
concat create the string result
// concat create the string result
func concat(digits []int, repeatingDigitIndex int) string {
	var buffer bytes.Buffer
	for i := 0; i < repeatingDigitIndex; i++ {
		buffer.WriteString(strconv.Itoa(digits[i]))
	}
	if repeatingDigitIndex == len(digits)-1 && digits[repeatingDigitIndex] == 0 {
		return buffer.String()
	}
	buffer.WriteString(leftParenthesis)
	for i := repeatingDigitIndex; i < len(digits); i++ {
		buffer.WriteString(strconv.Itoa(digits[i]))
	}
	buffer.WriteString(rightParenthesis)
	return buffer.String()
}
func concat ( digits [ ] int , repeatingDigitIndex int ) string { var buffer bytes . Buffer for i := 0 ; i < repeatingDigitIndex ; i ++ { buffer . WriteString ( strconv . Itoa ( digits [ i ] ) ) } if repeatingDigitIndex == len ( digits ) - 1 && digits [ repeatingDigitIndex ] == 0 { return buffer . String ( ) } buffer . WriteString ( leftParenthesis ) for i := repeatingDigitIndex ; i < len ( digits ) ; i ++ { buffer . WriteString ( strconv . Itoa ( digits [ i ] ) ) } buffer . WriteString ( rightParenthesis ) return buffer . String ( ) }
concat create the string result
concat create the string result
// If the repeating result is a 0, return // Collect repeating digits between paranthesis