1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-07 22:22:29 +08:00

feat: add ReverseCopy

This commit is contained in:
dudaodong
2025-02-14 16:23:46 +08:00
parent 23e61f1acf
commit 2e619e48a3
5 changed files with 103 additions and 1 deletions

View File

@@ -937,6 +937,19 @@ func ExampleReverse() {
// [d c b a]
}
func ExampleReverseCopy() {
strs := []string{"a", "b", "c", "d"}
reversedStrs := ReverseCopy(strs)
fmt.Println(reversedStrs)
fmt.Println(strs)
// Output:
// [d c b a]
// [a b c d]
}
func ExampleIsAscending() {
result1 := IsAscending([]int{1, 2, 3, 4, 5})