diff --git a/exercises/practice/raindrops/.meta/raindrops.ys b/exercises/practice/raindrops/.meta/raindrops.ys index a54efa0..7749c57 100644 --- a/exercises/practice/raindrops/.meta/raindrops.ys +++ b/exercises/practice/raindrops/.meta/raindrops.ys @@ -3,12 +3,5 @@ dict =:: { 3: Pling, 5: Plang, 7: Plong } defn convert(number): - words =: - reduce _ [] [3 5 7]: - fn(acc num): - concat acc: - when (number % num).!: -[dict.$num] - - if words.?: - str: words* - str: number + words =: mapcat(\((number % _).! &&& dict.get(_)) [3 5 7]) + if words.?: str(words*) str(number) diff --git a/exercises/practice/sum-of-multiples/.meta/sum-of-multiples.ys b/exercises/practice/sum-of-multiples/.meta/sum-of-multiples.ys index 19372de..42c18e4 100644 --- a/exercises/practice/sum-of-multiples/.meta/sum-of-multiples.ys +++ b/exercises/practice/sum-of-multiples/.meta/sum-of-multiples.ys @@ -1,8 +1,4 @@ !yamlscript/v0 defn sum(factors limit): - std/sum: - reduce _ [] factors: - fn(nums num): - when(num.? range(num limit num)): - .concat(nums).distinct() + factors.mapcat(\(when(_.? range(_ limit _))) _).distinct().std/sum()