7 kyu
Get length of the list recursively
217 of 1,470wichu
Loading description...
Fundamentals
Functional Programming
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.
JS: Should mention that the input can be a string.
this is a 10 kyu level
This is a good kata to practice recursion. Not everyone is a recursion ninja
me likey!
Please, NASM Translation
Approved
There's a test with
NULL
in C. It doesn't seem to be a valid argument according to the description and having multiple different representations of the same empty list is illogical and confusing.Why not just to edit the description? The
NULL
case has a right to exist to indicate the absence of a list... It seems O.k. to use0 for emptiness
andNULL for absence
Think the issue could be closed...If a list is given, how can it be absent? And if a list is absent, there's nothing to calculate the length of, so it automatically implies some optional result (bool + pointer or some kind of error codes in C), which is definitely not what the kata is about.
A list is absent when the memory is not allocated, probably
NULL
or somerubbish
! Another case:This is a very strong point! In such cases
-1
is usually returned when it's not possible to returnNULL
followingBest Practices
! But more than fifty solutions will be broken... O.k. could throw awayNULL
cases from NASM Translation and fork C Confirm?_
Yes, at least
NULL
tests should be removed. Or at most the whole C and JavaScript translations because this kata was about liked lists.Fixing...
Please,
Resolved
C TranslationUniapi's C translation is approved. But the issue is still open: the JS translation should be updated.
@Unnamed, Will say something?
This comment has been hidden.
Pointless
This comment has been hidden.
This clearly says that the input is a list (an array).
Even though a string is an iterable like an array, it's still a string, and if the input can contain anything other than a list, I think you should mention that in the description.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Note a typo in the Description: "funcion".
Also, it looks like the tested inputs are sometimes not an array (i.e. a string), so it'd be helpful to describe how to process those in the Description.
Thanks!
Please review C translation (in this case, C uses particular format to make the problem non-trivial)
I don't know why we need use recursive in this kata. If you need to test recursion, please set a suitable target.