Fix example
wax failing on duplicate values
This commit is contained in:
parent
3ab242de11
commit
00fae8ede4
1 changed files with 11 additions and 7 deletions
18
README.md
18
README.md
|
|
@ -128,13 +128,17 @@ Padding is achieved as usual:
|
||||||
|
|
||||||
;; min of last 3 items
|
;; min of last 3 items
|
||||||
=> (sequence
|
=> (sequence
|
||||||
(x/window 3
|
(x/window 3
|
||||||
(fn
|
(fn
|
||||||
([] (sorted-set))
|
([] (sorted-map))
|
||||||
([s] (first s))
|
([m] (key (first m)))
|
||||||
([s x] (conj s x)))
|
([m x] (update m x (fnil inc 0))))
|
||||||
disj)
|
(fn [m x]
|
||||||
nums)
|
(let [n (dec (m x))]
|
||||||
|
(if (zero? n)
|
||||||
|
(dissoc m x)
|
||||||
|
(assoc m x (dec n))))))
|
||||||
|
nums)
|
||||||
(11 8 8 8 6 6 6 10)
|
(11 8 8 8 6 6 6 10)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue