You are viewing a single comment's thread. Return to all comments →
Haskell recursive solution
f :: Int -> [Int] -> [Int] f n [] = [] f n (x:arr) | x<n = x : f n arr | otherwise = f n arr -- The Input/Output section. You do not need to change or modify this part main = do n <- readLn :: IO Int inputdata <- getContents let numbers = map read (lines inputdata) :: [Int] putStrLn . unlines $ (map show . f n) numbers
Seems like cookies are disabled on this browser, please enable them to open this website
Filter Array
You are viewing a single comment's thread. Return to all comments →
Haskell recursive solution