开发者

Scheme: Making a list of sublist maxes

Given a list, each item of which is an (r g b) color, return a list consisting of 开发者_高级运维the maximum component in each color.

Example: given ((123 200 6) (10 30 20) (212 255 10) (0 0 39) (37 34 34)), code should return (200 30 255 39 37)


(define (sublist-max list-of-lists)
    (map (lambda (sublist) (apply max sublist)) list-of-lists))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜