September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,11 @@
|
|||
fcn columns(m){ // m is list of lists of zeros/beads, # beads is n, eg (0,0,0)==3
|
||||
m
|
||||
.apply("len") // (0,0,0)-->3
|
||||
.reduce("max") // largest bead stack
|
||||
.walker() // [0..max]
|
||||
.apply('wrap(i){ m.filter('wrap(s){ s.len() > i }).len().pump(List,0) });
|
||||
}
|
||||
|
||||
fcn beadSort(data){
|
||||
data.apply("pump",List,0):columns(_):columns(_).apply("len");
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
T(5,3,1,7,4,1,1):beadSort(_).println();
|
||||
T(4,3,3,2,1):beadSort(_).println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue