Qurak

Combine and rearrange lists

Guida pratica 15 passi, eseguiti in ordine in una sola sessione. Ogni passo è stato eseguito sul motore e l'output qui sotto è ciò che ha prodotto.

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

Funzioni usate

Ricette correlate

Tutte le ricette · Guida delle funzioni · Usa questo da un client MCP