Skip to content

Instantly share code, notes, and snippets.

@jergason
Created November 12, 2014 18:55
Show Gist options
  • Save jergason/cd99acc1c28631a0d8eb to your computer and use it in GitHub Desktop.
Save jergason/cd99acc1c28631a0d8eb to your computer and use it in GitHub Desktop.
what am i even doing
f :: Int -> [Int] -> [Int]
f n arr = -- Complete this function
concat $ map (makeN n) arr
makeN :: Int -> (Int -> [Int])
makeN n =
(\x -> map (\i -> x) [1..n])
-- 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