
Write a function that returns 1 when two byte slices taken from the same array share at least one byte, and 0 when they do not.
ranges_overlap(buf, 6, buf + 4, 6)Expected result
1For your own tracking. Tests grade your code.
ranges_overlap(buf, 4, buf + 4, 4)Expected result
0ranges_overlap(buf, 0, buf, 8)Expected result
0Expected files
ranges_overlap.cAllowed functions
None. Write every helper yourself.
Allowed headers

v0.40: Create exercises. Challenge the community.
Meet Studio →Write a function that returns 1 when two byte slices taken from the same array share at least one byte, and 0 when they do not.
ranges_overlap(buf, 6, buf + 4, 6)Expected result
1For your own tracking. Tests grade your code.
ranges_overlap(buf, 4, buf + 4, 4)Expected result
0ranges_overlap(buf, 0, buf, 8)Expected result
0Expected files
ranges_overlap.cAllowed functions
None. Write every helper yourself.
Allowed headers

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