MathTop

lastperm 函数

按逆输入顺序返回最后一个 k 元排列。

语法

  • combinat:-lastperm(n)
  • combinat:-lastperm(list, k)
  • lastperm(n)
  • lastperm(list, k)

参数与选项

list形如 [1, 2, 3] 的列表字面量。
k排列中的元素数量。

示例

  1. 最后一个排列combinat:-lastperm(3)返回 [3, 2, 1]。