Created
January 6, 2019 22:40
-
-
Save RazorSh4rk/3b43d27fad7f2e2332379bc77db3d6de to your computer and use it in GitHub Desktop.
Hackerrank helper for OCaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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