Look-and-say sequence: Difference between revisions
Content added Content deleted
Line 691: | Line 691: | ||
let lookandsay = |
let lookandsay = |
||
Str.global_substitute (Str.regexp "\\(.\\)\\1*") |
Str.global_substitute (Str.regexp "\\(.\\)\\1*") |
||
(fun s -> |
(fun s -> string_of_int (String.length (Str.matched_string s)) ^ |
||
Str.matched_group 1 s) |
|||
String.sub m 0 1) |
|||
let () = |
let () = |