feat: add ReverseCopy

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

No files matched your search

+13
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})