
Write str_join, which allocates one new string holding the n strings of parts separated by the byte sep, and hands that block to the caller.
str_join({"git", "log", "oneline"}, 3, '-')Expected result
[git-log-oneline] parts=git|log|onelineFor your own tracking. Tests grade your code.
str_join({"solo"}, 1, '-')Expected result
[solo] parts=solostr_join(NULL, 0, '-')Expected result
[]str_join({"", "b", ""}, 3, ',')Expected result
[,b,] parts=|b|str_join({"one", "two", "three"}, 3, '\0')Expected result
[one.two.three] parts=one|two|threeExpected files
str_join.cAllowed functions
mallocAllowed headers

v0.40: Create exercises. Challenge the community.
Meet Studio →Write str_join, which allocates one new string holding the n strings of parts separated by the byte sep, and hands that block to the caller.
str_join({"git", "log", "oneline"}, 3, '-')Expected result
[git-log-oneline] parts=git|log|onelineFor your own tracking. Tests grade your code.
str_join({"solo"}, 1, '-')Expected result
[solo] parts=solostr_join(NULL, 0, '-')Expected result
[]str_join({"", "b", ""}, 3, ',')Expected result
[,b,] parts=|b|str_join({"one", "two", "three"}, 3, '\0')Expected result
[one.two.three] parts=one|two|threeExpected files
str_join.cAllowed functions
mallocAllowed headers

Run the tests to grade your code
Build your code, then check each test here. Open a result to inspect its output.