Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
9
Task/Repeat-a-string/OCaml/repeat-a-string-1.ml
Normal file
9
Task/Repeat-a-string/OCaml/repeat-a-string-1.ml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let string_repeat s n =
|
||||
let s = Bytes.of_string s in
|
||||
let len = Bytes.length s in
|
||||
let res = Bytes.create (n * len) in
|
||||
for i = 0 to pred n do
|
||||
Bytes.blit s 0 res (i * len) len
|
||||
done;
|
||||
(Bytes.to_string res)
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue