You are viewing a single comment's thread. Return to all comments →
Haskell
module Main where import qualified Data.IntMap as M dist :: [Int] -> M.IntMap Int dist = M.fromListWith (+) . flip zip (repeat 1) solve :: [Int] -> [Int] -> [Int] solve short full = M.keys $ M.filter (> 0) $ M.differenceWith (\a b -> Just (a - b)) (dist full) (dist short) main :: IO () main = do _ <- getLine short <- map read . words <$> getLine :: IO [Int] _ <- getLine full <- map read . words <$> getLine :: IO [Int] putStrLn $ unwords $ map show $ solve short full
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
Haskell