lastperm 函数
按逆输入顺序返回最后一个 k 元排列。
语法
combinat:-lastperm(n)combinat:-lastperm(list, k)lastperm(n)lastperm(list, k)
参数与选项
list | 形如 [1, 2, 3] 的列表字面量。 |
|---|---|
k | 排列中的元素数量。 |
示例
- 最后一个排列
combinat:-lastperm(3)返回 [3, 2, 1]。
按逆输入顺序返回最后一个 k 元排列。
combinat:-lastperm(n)combinat:-lastperm(list, k)lastperm(n)lastperm(list, k)list | 形如 [1, 2, 3] 的列表字面量。 |
|---|---|
k | 排列中的元素数量。 |
combinat:-lastperm(3)返回 [3, 2, 1]。