Skip to content

Commit

Permalink
utils: update Sort2DArray's comment
Browse files Browse the repository at this point in the history
  • Loading branch information
blueBlue0102 committed Nov 13, 2024
1 parent 9c0cdb5 commit e8178b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/utils/Slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import (
"sort"
)

// 以 in-place 的方式排序二維陣列
// Sort2DArray sorts a 2D array by comparing elements in each subarray lexicographically.
// If the elements are equal up to the length of the shorter subarray,
// the shorter subarray is considered smaller.
func Sort2DArray[T cmp.Ordered](matrix [][]T) [][]T {
sort.SliceStable(matrix, func(i, j int) bool {
minLen := min(len(matrix[i]), len(matrix[j]))
Expand Down

0 comments on commit e8178b3

Please sign in to comment.