-
-
Save BookGin/96a217b8eb484391146f67d932241381 to your computer and use it in GitHub Desktop.
histogram
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
histogram a = concat (map (++"\n") ([concat [if c!!j >= i then "*" else " " | j <- [0..9]] | i <- reverse [1..maximum c]] ++ ["==========", "0123456789"])) | |
where c = [length (filter (==i) a) | i <- [0..9]] | |
-- putStrLn d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment