5 kyu
Find number in an array # 1
Loading description...
Algorithms
Puzzles
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.
I'm pretty sure this kata has become unsolvable due to runner performance issues. The tests expect runtimes below 6 ms, but my single-sweep O(n) solution cannot get below 20 ms. Can anyone confirm this, and perhaps increase the threshold from 6 ms to, say, 30 ms?
Some previous solution don't work, see exor's post below.
It might have been a problem back then, but I did not experience any performance issues solving this now.
Are you sure? I constantly get
You code is too slow ;-): expected '7ms' to equal 'Less than 6ms per testcase'
Yep, you are right, my implementation was not fast enough. Solved it. :D
Approved
Finally it's done.. but with some nuance..
May be 6ms per test sometime reverse to 9ms per test..Who knows?. Just... for couple of test - not for all ))
Perhaps that means you were not using the correct algorithm ;-)
This comment has been hidden.
perhaps your code spent more time to determine which situation is. ;-)
n=length-1 indexOf(n)
Apparently indexOf(n) spent all my time ))
I had fun with this kata to get performance tests have to run like a rocket. Great kata!!!
;-)