Skip to content

Instantly share code, notes, and snippets.

@jin
Created November 29, 2015 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jin/81b4738b247d8c2ee161 to your computer and use it in GitHub Desktop.
Save jin/81b4738b247d8c2ee161 to your computer and use it in GitHub Desktop.
let rec read_lines () =
try let line = read_line () in
int_of_string (line) :: read_lines()
with
End_of_file -> []
let f n arr = (*Complete this function*)
let () =
let n::arr = read_lines() in
let ans = f n arr in
List.iter (fun x -> print_int x; print_newline ()) ans;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment