Skip to content

Instantly share code, notes, and snippets.

@dflima
Created August 19, 2016 20:49
Show Gist options
  • Save dflima/04dc8d6267f856ba633c16a2be2b0230 to your computer and use it in GitHub Desktop.
Save dflima/04dc8d6267f856ba633c16a2be2b0230 to your computer and use it in GitHub Desktop.
f :: Int -> [Int] -> [Int]
f n arr = concatMap (replicate n) arr
-- This part handles the Input and Output and can be used as it is. Do not modify this part.
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