mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-11-14 07:10:48 -05:00
8 lines
205 B
Zig
8 lines
205 B
Zig
const std = @import("std");
|
|
|
|
/// Writes a reversed copy of `s` to `buffer`.
|
|
pub fn reverse(buffer: []u8, s: []const u8) []u8 {
|
|
@memcpy(buffer, s);
|
|
std.mem.reverse(u8, buffer);
|
|
return buffer;
|
|
}
|