pairs, memoize

This commit is contained in:
2020-12-11 19:55:45 -07:00
parent 219cadd040
commit f2680c6920
3 changed files with 32 additions and 3 deletions

View File

@@ -1,6 +1,5 @@
(defun differences [:kiss.List<Int> ratings]
(for idx (range (- ratings.length 1))
(- (nth ratings (+ idx 1)) (nth ratings idx))))
(for pair (pairs ratings) (- 0 (apply - pair))))
(defun distribution [:kiss.List<Int> numbers]
(let [:Map<Int,Int> dist (new Map)]