We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Filter Array
Filter Array
Sort by
recency
|
150 Discussions
|
Please Login in order to post a comment
In REXX, you can filter integers less than a given delimiter by reading the delimiter first with parse pull, then looping through the input with do while lines() > 0. For each number, use if num < delim then say num to print values below the limit. This keeps the original order, like selecting the right tools in iPhone Stardew Valley.
Ask ChatGPT
You are expected to write a custom filter function without using built-in methods. Just return a new list with elements less than the delimiter while preserving order. Make sure your function matches the given signature for your language.
The generate code by HR is bad. Haskell is a functional programming language and it should be a declarative style rather than imperative.
for example this processes whole input like a stream. Betpkr Much more elegant.
filterIt :: [Int] -> [String] filterIt (a:xs) = map show $ filter (\x -> x < a) xs
main = interact $ unlines . filterIt. map read. words
F#
Scala