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: 1725. Number Of Rectangles That Can Form The Largest Square.go
    path of file: ./repos/LeetCode-Go/leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square
    
    the code of the file until where you have to start completion: package leetcode

func countGoodRectangles(rectangles [][]int) int {
	minLength, count := 0, 0
	for i := range rectangles {
		minSide := 0
		if rectangles[i][0] <= r
    
func countGoodRectangles(rectangles [][]int) int {
	minLength, count := 0, 0
	for i := range rectangles {
		minSide := 0
		if rectangles[i][0] <= rectangles[i][1] {
			minSide = rectangles[i][0]
		} else {
			minSide = rectangles[i][1]
		}
		if minSide > minLength {
			minLength = minSide
			count = 1
		} else if minSide == minLength {
			count++
		}
	}
	return count
}