Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Permutations/K/permutations-1.k
Normal file
12
Task/Permutations/K/permutations-1.k
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
perm:{:[1<x;,/(>:'(x,x)#1,x#0)[;0,'1+_f x-1];,!x]}
|
||||
perm 2
|
||||
(0 1
|
||||
1 0)
|
||||
|
||||
`0:{1_,/" ",/:x}'r@perm@#r:("some";"random";"text")
|
||||
some random text
|
||||
some text random
|
||||
random some text
|
||||
random text some
|
||||
text some random
|
||||
text random some
|
||||
25
Task/Permutations/K/permutations-2.k
Normal file
25
Task/Permutations/K/permutations-2.k
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
perm:{x@m@&n=(#?:)'m:!n#n:#x}
|
||||
|
||||
perm[!3]
|
||||
(0 1 2
|
||||
0 2 1
|
||||
1 0 2
|
||||
1 2 0
|
||||
2 0 1
|
||||
2 1 0)
|
||||
|
||||
perm "abc"
|
||||
("abc"
|
||||
"acb"
|
||||
"bac"
|
||||
"bca"
|
||||
"cab"
|
||||
"cba")
|
||||
|
||||
`0:{1_,/" ",/: $x}' perm `$" "\"some random text"
|
||||
some random text
|
||||
some text random
|
||||
random some text
|
||||
random text some
|
||||
text some random
|
||||
text random some
|
||||
9
Task/Permutations/K/permutations-3.k
Normal file
9
Task/Permutations/K/permutations-3.k
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
prm:{$[0=x;,!0;,/(prm x-1){?[1+x;y;0]}/:\:!x]}
|
||||
perm:{x[prm[#x]]}
|
||||
|
||||
(("some";"random";"text")
|
||||
("random";"some";"text")
|
||||
("random";"text";"some")
|
||||
("some";"text";"random")
|
||||
("text";"some";"random")
|
||||
("text";"random";"some"))
|
||||
7
Task/Permutations/K/permutations-4.k
Normal file
7
Task/Permutations/K/permutations-4.k
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
prm:{$[x~*x;;:x@o@#x];(x-1){,/'((,(#*x)##x),x)m*(!l)+&\m:~=l:1+#x}/0}
|
||||
perm:{x[prm[#x]]
|
||||
|
||||
perm[" "\"some random text"]
|
||||
(("text";"text";"random";"some";"random";"some")
|
||||
("random";"some";"text";"text";"some";"random")
|
||||
("some";"random";"some";"random";"text";"text"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue