rotateRightMutation<
T>(values,first,second): readonlyT[]
Defined in: packages/evolution/src/permutation.ts:95
Rotate an inclusive ascending segment one position right in a new array. Equal indices are a fresh-array no-op. Runs in O(n) time and space and never mutates the input.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”values
Section titled “values”readonly T[]
number
second
Section titled “second”number
Returns
Section titled “Returns”readonly T[]
Throws
Section titled “Throws”With code INVALID_PERMUTATION when values is not an array or
INVALID_INDEX when an index is outside it or first exceeds second.