Skip to content

Instantly share code, notes, and snippets.

@e-parkinson
Created August 25, 2015 08:53
Show Gist options
  • Select an option

  • Save e-parkinson/13396eab193e238aac8e to your computer and use it in GitHub Desktop.

Select an option

Save e-parkinson/13396eab193e238aac8e to your computer and use it in GitHub Desktop.
f :: Int -> [Int] -> [Int]
f n arr = concatMap (replicate n) arr
main :: IO ()
main = getContents >>=
mapM_ print. (\(n:arr) -> f n arr). map read. words
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment