Qurak

Combine and rearrange lists

How-to 15 steps, run in order in one session. Every step was executed against the engine and the output below is what it produced.

Step 1
v = {3, 1, 3, 2, 5, 4}
Output
{3, 1, 3, 2, 5, 4}
Step 2
Sort[v]
Output
{1, 2, 3, 3, 4, 5}
Step 3
Union[v]
Output
{1, 2, 3, 4, 5}
Step 4
v
Output
{3, 1, 3, 2, 5, 4}
Step 5
v = Union[v]
Output
{1, 2, 3, 4, 5}
Step 6
v
Output
{1, 2, 3, 4, 5}
Step 7
Reverse[v]
Output
{5, 4, 3, 2, 1}
Step 8
RotateLeft[v, 2]
Output
{3, 4, 5, 1, 2}
Step 9
RotateRight[v, 2]
Output
{4, 5, 1, 2, 3}
Step 10
PadLeft[v, 10, x]
Output
{x, x, x, x, x, 1, 2, 3, 4, 5}
Step 11
Partition[v, 2]
Output
{{1, 2}, {3, 4}}
Step 12
Partition[v, 2, 1]
Output
{{1, 2}, {2, 3}, {3, 4}, {4, 5}}
Step 13
Split[{1, 4, 1, 1, 1, 2, 2, 3, 3}]
Output
{{1}, {4}, {1, 1, 1}, {2, 2}, {3, 3}}
Step 14
Flatten[{{a, b}, {c, {d}, e}, {f, {g, h}}}]
Output
{a, b, c, d, e, f, g, h}
Step 15
Join[{a, b}, {c, d, e}, {f, g, h}]
Output
{a, b, c, d, e, f, g, h}

Functions used

Related recipes

All recipes · Function reference · Use this from an MCP client