HR F#: Filter Array

The next HackerRank functional problem is Filter Array.

Filter a given array of integers and output only those values that are less than a specified value X.

The idea is to create a filtering function, not using the one from the standard library. With what is already known from solving previous problem[1], following the recommended method signature should not be difficult.

The recommended signature is upper limit and list, returns list.

Instead of lists, let's use the sequence:

let f x s =
seq { for v in s do if v < x then yield v }


readItemsFromInput was introduced in the solution for the problem "List Replication".

The solution:

open System

let f x s =
seq { for v in s do if v < x then yield v }

let rec readItemsFromInput () = seq {
match line with
| null -> ()
| _ -> yield line |> int