Feeling a little dim, but what would be the best way to implement a function that gets the cartesian product of []T with n repeats so something with a signature of comptime T: type, allocator: std.mem.Allocator, items: []T, repeat: usize) ![][]T where the output is a slice that is items.len * n and contains slices of len n.
If it was just a one off and i did not need to support a dynamic value of n i would just write it as nested loops, and preallocate everything.