Skip to content

Instantly share code, notes, and snippets.

@RazorSh4rk
Created January 6, 2019 22:40
Show Gist options
  • Save RazorSh4rk/3b43d27fad7f2e2332379bc77db3d6de to your computer and use it in GitHub Desktop.
Save RazorSh4rk/3b43d27fad7f2e2332379bc77db3d6de to your computer and use it in GitHub Desktop.
Hackerrank helper for OCaml
let rec read_lines () =
try let line = read_int () in
line :: read_lines ()
with
_ -> []
;;
let f ls =
(* write your code here *)
;;
let () =
let ls = read_lines() in
let ans = f ls 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