5 kyu
Multisize Nonogram Encoder
119оkabe
Loading description...
Games
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.
Why are we using
tuple
instead oflist
? Also, wouldn't it be better for the input to be a 2D array ofbool
instead ofint
?Some argue that tuples are Python way to have immutable lists. I am not sure I agree, but again, I am not a Python person.
Personally, i always saw tuples mainly as fixed size lists rather than immutable ones. I like using them for "return a pair" or to represent coordinates in a grid.
But still, why does it matter if the input or output are immutable? What makes this kata any different from other katas that have sequences as input? Pretty much all other katas use lists as input and output, even though those values are just as immutable as this kata's.
If they're immutable, they're also fixed size. I think this is a case where there's no right answer and it's up to preference. Since the types of the inner elements are heterogeneous (for the
clues
), and that the sequences themselves represent finite sets of data that will never change since the input they're based on will never change, this ticks both major boxes to justify using atuple
. The only gains you get by returning alist
oflist
s is that the function's user will be allowed to modify the returned lists afterwards, but again, those are very subjective API design choices. Again, since the answer is obvious even before runtime, to me it semantically reads likenamed_tuple('clues', 'clue1, clue2, clue3, ..., clueN')
Not a 5 kyu. 7 or 6kyu would have been more appropriate.
6kyu I was going to comment. Weird that not more warriors slayed this one.
suggestion rejected, average vote was 5 kyu, anyone is able to participate in beta testing and vote.
Nice kata. Approved at kyu 5.