Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Scheme/DrRacket

Name: Anonymous 2013-01-10 13:28

How do I write a function that takes any integers in a list and produces the number of values in the list whose one's digit (i.e. the least significant or rightmost digit) is 1. For example,
(ones (list 82 231 1 22 1000)) => 2?

Name: Anonymous 2013-01-10 13:56

>>5>>4

Lisp                        | Haskell
----------------------------|---------------------------------------------------
reduce                      | fold, foldl, foldr, foldl',
                            | foldr1, foldl1, foldl1...
----------------------------|---------------------------------------------------
map                         | map, mapM, mapM_, mapAccumL, mapAccumR, mapAccum,
                            | mapAndUnzipM, mempty, mappend, mapAccumRWithKey,
                            | mapAccumWithKey, mapMaybe, mapMaybeT mapEither,
                            | mapEitherWithKey, mapMaybeWithKey, mapFst, mapSnd,
                            | mapIndices, mapArray, mapListT, mapMonotonic,
                            | concatMap, amap, ixmap...
----------------------------|---------------------------------------------------
elt                         | fst snd thd fth ffth...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List