Member-only story
Rust Challenge: Matrix
Learning Rust Through Small Challenges
In this mini Rust challenges, we will solve a problem using Rust. The goal of these challenges is to get comfortable reading and writing Rust code by solving various problems.
I do them on a daily basis, so if you want to join please come back here every day and check every challenge and lets us solve them together.
Challenge
These challenges are based on exercises from Exercism. You can find the original challenge and more on their platform below.
Instructions
Given a string representing a matrix of numbers, return the rows and columns of that matrix.
So given a string with embedded newlines like:
9 8 7
5 3 2
6 6 7
representing this matrix:
1 2 3
|---------
1 | 9 8 7
2 | 5 3 2
3 | 6 6 7
your code should be able to spit out:
- A list of the rows, reading each row left-to-right…