package main

import (
	"fmt"
	"slices"
)

func main() {
	// section: example
	slice1 := []int{1, 2, 3}
	slice2 := []int{1, 2, 4}
	slice3 := []int{1, 2, 3, 4}

	// Compare returns:
	// -1 if slice1 < slice2
	//  0 if slice1 == slice2
	// +1 if slice1 > slice2
	fmt.Printf("Compare([1,2,3], [1,2,4]): %d\n", slices.Compare(slice1, slice2))
	fmt.Printf("Compare([1,2,3], [1,2,3]): %d\n", slices.Compare(slice1, slice1))
	fmt.Printf("Compare([1,2,4], [1,2,3]): %d\n", slices.Compare(slice2, slice1))
	fmt.Printf("Compare([1,2,3], [1,2,3,4]): %d\n", slices.Compare(slice1, slice3))
	// section: example
}
