7 kyu
Find the Missing Number
949 of 8,200blu12758
Loading description...
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.
it's buggy,my output is same as the answer but it shows faild even I changed type of output to list or string,it steel feedback an faild
I used print instead of return,it solved.just use return :) <3
The random tests in Lua have multiple missing and repeated numbers.
This fork should fixes the issue.
Merged
could you check the mix test solution , i have gotten the test passed but it also says 'none should == 100'(the answer was correct(28)and 100 was not absent i check manually)
It is difficult to find problems in your solution without knowing what your solution is.
If the solution I see is your most recent one, it seems that indeed, it does not handle the case when the missing number is 100. I think you did some mistake when checking what input fails.
Anyway, your solution is buggy, it is not a kata issue.
This comment has been hidden.
First of all, reading unformatted code is really difficult. You really need to use code formatting when showing solution.
The next thing is, your problem is when missing num is 100. Try this assertion and see:
test.assert_equals(missing_no(list(range(100))), 100)
Lua translation !
"0 to 100 inclusively" => "1 to 100 inclusively"
Can you advise which language doesn't uses the
0
to100
inclusive range?Perhaps I thought the range of answers would be 1 to 100 inclusive. I can't exactly remember. Thanks.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/184.
Please join the discussion to help us identify duplicate kata and retire them.
This comment has been hidden.
This comment has been hidden.
Hello, so what was it? Your comment is hidden :)
COBOL translation (author inactive).
approved
C# translation ready! Please review and approve.
Approved!
C translation (author gone)
Thanks :)
Basically take your solution from this and change N from 9 to 100 ^w^
Elixir translation.
The basic test in Python should use fixed inputs instead of randomly generated one.
JavaScript translation kumited. Feel free to check :)
Approved
Thanks
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
done
Kotlin Translation here -- Please review and approve
This comment has been hidden.
This doesn't work I'd suppose
python: the given arrays are sorted
https://www.codewars.com/kumite/5eeb0ce3cd307f0029c7c424?sel=5ef9bd1cdc9649001eaa693a
done
woops
Ruby translation kumited -- please check and approve (note: author i is inactive)
approved
This comment has been hidden.
translation or solution?
Idk, I'm new to it. I made an algorithm for this kata but in JavaScript. I think it is a solution, but I'm not sure. Do you know why I sometimes get a green rectangle in the textarea?
You can't. But you can add a JS translation and use your solution in it. Btw, I've translated it to JS so you can just submit your JS solution now.
This comment has been hidden.
see issue above
This comment has been hidden.
You're right
This comment has been hidden.
Yep, that absolutely works, and that's how many people (including myself) have chosen to solve it. Also just so you know, in Python you can use a specialized function to get what you're looking for without having to write out the loop to iterate through it. (sorry I'm being vague, trying to avoid having to use the spoiler flag!)
This being an interview question, that is more about the mentioned complexities than about solving the actual problem, wouldn't it be nice to ask for those complexities as well? As a string or as an actual function?
And how are you going to test "time and space complexities of your solution"? There are no requirements, so they can be anything.
You don't.
If people return complexities different from what they actually implemented, they'll just fail the interview. ATM you don't have to reason about the complexities at all; you just hammer out your
O(n²)
solution because BubbleSort seemed like a good idea and pass a 7 kyu kata ..( You could actually test the time complexity of the solution of course. But I was not suggesting that. )
are either of you aware of any kata that do this? that expect you to actually identify the complexity of your solution in order to pass the kata? seems this would be something of value for CW
There's performance kata for everything from
O(1)
on up, but identifying the time complexity of your own solution, let alone having it actually checked - no, I don't think so.Mind that I was just suggesting people return the best possible time complexity actually, not necessarily the complexity of their own solution. Hard to accurately test that one. ( But then, there's multiple kata that ask for random answers and then try to test randomness. )
great, thanks for the feedback. for this kata, the mention of complexity at least led me to trying mutliple approaches, and learned a new method for the language. edit: but I agree with OP
Clojure ans Haskell translations: https://www.codewars.com/kumite/57f7d74304bb90de94000190?sel=57f7d74304bb90de94000190 https://www.codewars.com/kumite/5b719ec74eb880181200003b?sel=5b719ec74eb880181200003b
Approved ;-)
Submitted C translation. :)