2 ms·
A probably better OCaml implementation: https://gist.githubusercontent.com/a-nikolaev/b6fb099ebb28d7f58e71e51981960920/raw/244d73198fdd7f2db7db2d3f359e74676327
by a-nikolaev 9y ago
A probably better OCaml implementation:
https://gist.githubusercontent.com/a-nikolaev/b6fb099ebb28d7f58e71e51981960920/raw/244d73198fdd7f2db7db2d3f359e746763275742/sumup.ml https://gist.githubusercontent.com/a-nikolaev/b6fb099ebb28d7...
With similar improvements to the solution posted in the article's comments, tail recursive, and no need for regular expressions. Works about 15% faster.