You need to sign in or sign up before continuing.×
3 kyu
T.T.T.35: Complete a matrix(3x3)
139myjinxin2015
Loading description...
Matrix
Algorithms
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.
this kata works? in validations says that: input = [ [ 10 ,null, 8 ], [ null,11, 6 ], [null, 7 ,null] ] expected result = null but my result is = [ [ 10, 1, 8 ], [ 2, 11, 6 ], [ 7, 7, 5 ] ]
in my result all lines sum 19
I didn't solve this kata, but reading the discussion I understand that you should return also
null
if there is more than one solution (what I think the author meant with the condition is not enough). It's probably what's happening here.Yep, you're right. Thank you
Liked this a lot, thank you :)
Nice very hard kata, as 2kyu.
Nice kata :) I think that some details are missing in the description -
Edit: Nvm, saw docgunthrop's question.
Question on some test cases:
Wouldn't this be a valid matrix with each row and column sum equaling
44
?And for the 2nd basic test:
This should be a valid matrix with each row and column sum equaling
25
.These two examples return null only because their results are uncertain. For example, they can be like this:
or other equaling value:
Ah, thanks for the clarification. So if more than one solution is possible, then that satisfies the condition of uncertainty. Nice challenging kata!
According to the description 0 is a valid value. Looks like it's not, e.g.
[[17,null,null],[11,16,1],[null,5,null]]
expects null, my the outcome is[[17,7,4],[11,16,1],[0,5,23]]
Sorry, but where is saying 0 is valid value? In the beginning of description, I wrote "positive number"
Yeah, true. Sorry. It's easy to miss that ;)
Anyway, thanks for your test, solve and feedback ;-)
I was also mislead by the description of the last example, where it says "the possible result contains negative number". It would be less confusing if it said "the possible result contains a number that is not positive".