6 kyu
Matrices I: A form of data storage
159MazTheMazy
Loading description...
Fundamentals
Mathematics
Data Structures
Algebra
Linear Algebra
Arrays
Lists
Matrix
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
struggling to understand the toArray() bit..can you provide a practical example output please?
For example, if you call
toArray()
on the matrixyou get
[["1", "2", "3"], ["4", "5", "6"]]
.Are you sure you want generic
E[][]
? Handling this is much harder than every other requirement of the kata.I don't see how it's "much harder", just one extra type cast.
This comment has been hidden.
As Unnamed pointed out, it really is pretty much just an
(E[][])
typecast when creating the new array. The point of this kata is to have matrices to be used like tables for data storage, so you really want to make it generic.Tests cases don't provide enough information to know what is failing.
Yes, I have experienced the same just now, it's because of an ArrayIndexOutOfBoundsException. Apparently, what JUnit does is it catches the exception and prints the message, but doesn't show the exception and doesn't print the stack trace either. I'll wrap my tests into try-catch blocks, so that every exception is printed out.
Resolved
Exactly Thank you :)
A very good Kata. Thanks!
Thank you! If you are interested on more, I'm publishing the next part soon.