Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transpose exercise #315
base: main
Are you sure you want to change the base?
transpose exercise #315
Changes from all commits
91d8a54
e90852c
ac52fe1
e865f05
96d9bca
52de5af
74f359c
c96e3f4
009cf95
8a8a8cf
978ac07
70ebe7e
8a4a4e7
e3544cb
49d20ee
321923e
89d0d01
9456bba
d031586
2262bd4
d77ac92
100e118
98ddc2c
df51470
ecdd0b6
b8adcde
63bddac
b1a4c1f
066787c
9ac273e
0727ecc
69dab2f
3b851a6
eca178d
35e9e18
2b54929
26ff5d6
925e6af
008fd0e
281fd43
9f03b7f
df78767
2470417
0c7ed6b
3219156
4a876f0
62f50c7
75d5220
deb3b7f
7abdaab
4d8892c
77b5c4e
2b7d363
12fae98
ac4b1ab
44213ae
4dd9516
8ae1404
435ff6a
05a2367
401954a
cdbd0fe
2ef1886
5f31d61
55de0ef
9947334
3b6f7c6
86c7638
8e6ff95
068a20b
1bc2263
3c90f2d
0df06b2
1f63916
4cd5596
13dfe94
1551365
f497c86
5ed367c
c32d87f
d4e956e
a3f3857
df62909
3de1993
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a trivial exercise, let's increase the difficulty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It must be possible to avoid having a
loop + for + break + continue
combination to perform this operation, makes it very hard to follow what is going on.Find a way to refactor this into something more readable.
You can use Go implementation as inspiration, it is very clear and concise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for
input
to be mutable, address this in all test casesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: let's format these row values into rows, and column values into columns.
You can use
#[cairofmt::skip]
to tell the formatter to not touch this then.This is similar to what we've done for minesweeper.
Note: apply this change to all tests where the formatter didn't already format the values like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should not pad to the right, i.e. add padding spaces to the rightmost columns (as per the problem description).
Copy/paste the actual expected output from the canonical data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before, no padding to the right is allowed (see canonical data)