5 kyu
Missing and Duplicate Number
218 of 230Uraza
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.
In this case : solution([2,2,2], [?,2]) // what result should I get ? Thanks
1
https://www.codewars.com/kumite/6309f130f5800d002480c5e9?sel=6309f130f5800d002480c5e9 Typescript version
One loop timeout... How to even solve it without loop
You have nested loops, indexOf is a loop-alike method.
Excellent Kata!
Same kata as this one: https://www.codewars.com/kata/untangle-list-deletion-slash-insertion/ except that that kata is currently in Python only.
I love this kata. Also I would love to read some feedback on my code. How fast and readable it is?
Good Kata!
You mean, do not sort with a built-in function :)
Harder as I first thought!
The official solution does not work for:
This test is not correct: the method should return [missing, duplicate] i.e. [6,3] in this case as 3 is the value that is duplicated.
Third test in attempt - [2,3,1,3,4,5] "pending" [6,3] ??? How can that be? Where does 6 come from?
The instructions say: "You are given an array containing all integers from 1 to N, except one that is missing." In this exemple, N=6 (it is the size of the input array) so the missing number is indeed 6.
Thank you! I got used to the fact that the minimum and maximum numbers are in the array itself. I should have read the condition more carefully. Thanks again!