7 kyu
Max span
251Dmitry Kudla
Loading description...
Algorithms
Arrays
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.
typo in description:
between the the same
-->between the same
There's no way this is 7kyu.
Updated Node to v12
Nice Kata but description is cryptic, spent too much time on understanding the task:
For arr = [1, 4, 2, 1, 4, 1, 4, 9, 7, 7, 7]
Non unique values are 1, 4 and 7
So maximum span is 6
For arr = [1, 4, 6, 1, 4, 4, 4, 8 ,6, 2, 3]
Non unique values are 1, 4 and 6
So maximum span is 7
[1, 2, 1, 1, 3, 4, 5, 6, 7, 8, 8] → 4 // span is (1, 2, 1, 1)
Span is a number of elements between same elements: Same element in this array are 1 and 8 only, so span(amount of numbers) between first
1
(index 0) and second 1 is == 1. betwen first and last - the span is == 2. Or span between same elements (1,1) and (8,8) is 5. You get (1,2,1,1) and 4 as a result I do NOT get it. Can you explain your kata further? PS.Next day — Finally I got it :) Maybe it's a good idea to make the description crystal clear.For me all the random tests say "Expected 1"
give me plz your solution.
Random tests are actual for many people and many solutions - I've just cheacked it. It is not an issue at all.
If you receive a issue report similar to above, usually this means that your input array can be modified by the user.
thanks
This comment has been hidden.
This comment has been hidden.
thanks, done