Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
s@(Sequence traits) countingSort &min: min &max: max
|
||||
[| counts index |
|
||||
min `defaultsTo: (s reduce: #min: `er).
|
||||
max `defaultsTo: (s reduce: #max: `er).
|
||||
counts: ((0 to: max - min) project: [| :_ | 0]).
|
||||
s do: [| :value | counts at: value - min infect: [| :count | count + 1]].
|
||||
index: 0.
|
||||
min to: max do: [| :value |
|
||||
[(counts at: value - min) isPositive]
|
||||
whileTrue:
|
||||
[s at: index put: value.
|
||||
index: index + 1.
|
||||
counts at: value - min infect: [| :val | val - 1]]
|
||||
].
|
||||
s
|
||||
].
|
||||
Loading…
Add table
Add a link
Reference in a new issue