diff --git a/src/exercises/day-1/solutions-morning.md b/src/exercises/day-1/solutions-morning.md index fce004c7..cd13ad56 100644 --- a/src/exercises/day-1/solutions-morning.md +++ b/src/exercises/day-1/solutions-morning.md @@ -7,3 +7,8 @@ ```rust {{#include for-loops.rs}} ``` +### Bonus question + +It honestly doesn't work so well. It might seem that we could use a slice-of-slices (`&[&[i32]]`) as the input type to transpose and thus make our function handle any size of matrix. However, this quickly breaks down: the return type cannot be `&[&[i32]]` since it needs to own the data you return. + +You can attempt to use something like `Vec>`, but this doesn't work very well either: it's hard to convert from `Vec>` to `&[&[i32]]` so now you cannot easily use `pretty_print` either. \ No newline at end of file