Posts by gifti
Factor, 95 bytes USING: kernel ranges sequences ; IN: r : r ( n q -- n ) [ [1..b] [ ] ] dip map-reduce ; inline
Answer
Factor, 147 bytes USING: kernel math math.text.utils sequences ; IN: n : n ( n -- s ) 0 swap [ [ 1 + dup dup 1 digit-groups sum mod 0 > ] loop dup ] replicate nip ;
Answer
Factor, 46 bytes USE: math.statistics IN: h ALIAS: h histogram
Answer
Factor, 108 bytes USING: assocs kernel math math.primes.factors ; IN: s : ? ( n -- ? ) group-factors [ nip 2 < ] assoc-all? ;
Answer
Factor, 122 bytes USING: kernel sequences sequences.windowed ; IN: c : c ( s -- s ) dup length [ dup last [ = ] curry count ] rolling-map ;
Answer