3 ms·
I'd love to see some example code for doing this. I'm trying to implement it in Kotlin and am curious how it would compare.
by talloaktrees 11y ago
I'd love to see some example code for doing this.
I'm trying to implement it in Kotlin and am curious how it would compare.
- dmichulke 11y ago(def mymap {"asd" 1 "qwe" 2 "rtz" 3 "foo" 4 "bar" 5 "quz" 6 "bnm" 7}) (let [ints (->> (filter (comp odd? count key) mymap) (sort-by (comp int last first)) (map (fn [[s i]] (+ (count s) i))))] (reduce + 0 (map * ints (reverse ints)))) Gives me 341