6 kyu
Normalizing Out of Range Array Indexes
547 of 963NPN
Loading description...
Arrays
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.
C# fork with adding empty list cases (may invalidate all solutions without check of that though)
Approved
The description should be language-agnostic as well (i.e. independent on each language presented for that kata)
C# doesn't have empty arrays as test cases.
.
And why should we use it? Isn't the main function tested anyway?
replaced in favor of testIt
JS:
Technically, the random tests were from the beginning, albeit via weird calls and whatever; now they're clearly random now. Also upgraded Node to 18 + testing framework as well :)
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Python translation
This provides practice with a pretty useful skill for a lot of different kata. Thanks for authoring it!
There are no tests with negative indices not divisible by the array length.
This comment has been hidden.
These were added.
This comment has been hidden.
You missed a couple of
return
s.This comment has been hidden.
My solution is passing the tests, but I can only get "Code timed out" when I submit it. Could the problem be my code?
Nevermind. I got it fixed.
I suggest change array in the description so that it is not sequence of numbers and especially indexes. As I started solving it with iterating through array looking for match.
Okay, I fixed the description and added tests for empty arrays.