7 kyu
Number climber
1,057 of 4,321ecolban
Loading description...
Fundamentals
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.
That is some clever obfuscation. It turns out to be definitely in the 7 kyu neighborhood, after random tests timed out, and I was briefly tempted to use pthreads. whew!
i thought it needs algorithim binary tree or somesthing like that using recursion but found that it need a better look numbers reltion to each other starting from n
work smarter not harder :P
python new test framework is required. updated in this fork
Approved
C Translation
LGTM, approved!
Scala translation
Approved
This comment has been hidden.
Fixed
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
one of my favorites so far :)
Crystal translation kumited, cheers :)
This comment has been hidden.
These solutions do not comply with the requirement: "Try generating the elements of the resulting list in ascending order, i.e., without resorting to a list reversal or prependig the elements to a list." Elements are pushed to and then popped from a stack, which effectively results in a list reversal.
This comment has been hidden.
Look at the other solutions. You will see that there are ways to build the result forward without a temporary list.
Given the constraint of creating the numbers in ascending order, many of the solutions have to be considered as false, since they don't "obey" the rules. In my opinion this kata is a tad too difficult for a 7kyu, given the constrains. See my Solution https://www.codewars.com/kata/reviews/57d4f9bac56ee0809a00000e/groups/582421067a8cb3e2120021a3 for a detailed explanation (with spoilers. Lots of...)
I agree with you, but warriors who solved the kata without abiding to the constraints voted for level 7. I wish I had a way of disqualifying solutions that do not obey the rules. Instead I have relied on people's sense of honor. Good for you for solving it while obeying the rules!
If I'm not mistaken solutions become obsolete when the testcases change. Not sure if that will affect the voted level though - probably not.
Really elegant, enjoyed this kata a lot. It is only a small shame that most of the top solutions do not meet the challenge of generating the sequence in ascending order.
C++-Translation kumited.
Please check it and approve. Thanks! ;)
C#-Translation kumited!
https://www.codewars.com/kumite/57d481751c9ad603fc00000d
Please check and approve it! :-)
Thanks for translating the kata to C#. I have approved your translation.
Great! Thanks.
Random tests are not compatible with Python3:
Should be fixed now.
I don't understand the instructions. "either the double or the double plus one of the preceding number" suggests [1,2,3] should be valid output for any sequence with N >= 3, no? Or how do you choose whether the 'unique sequence' result is supposed to be [1,3] ?
In
[1,2,3]
3
is neither2*2
nor2*2+1
then your sequence is invalid.The provided example (
[1, 3, 6, 13]
forN=13
) works so :3 = 1*2+1, 6 = 3*2, 13 = 6*2 +1
Thanks, that's MUCH clearer than the wording in the instructions.
This comment has been hidden.
What you are saying is not correct, or you are precluding things that are not precluded by this kata. I can't say more without spoiling the challenge. The test do not preclude you from using reverse, although the description says you should try and avoid it. So I suggest you submit a solution and then look at the solutions submitted and see if you cannot find one that does not use a reverse operation.
This comment has been hidden.
This comment has been hidden.
I've done a ruby solution that doesn't use a reverse or prepend. (I've also done one that does, so make sure you're looking at the right one.)
I also did solutions without prepending or reversing, if you are interested.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Also Weeyum I love your solution but it is still prepending.
This comment has been hidden.
But how do you convert to binary without prepending in the conversion?
This comment has been hidden.
This comment has been hidden.
Nice kata. thank
Add more tests
Done.
Ruby translation kumited.
'alr approved some time ago'
Make more test pls :) And also ask someone to make random test if you don't know how otherwise good kata actually saying reversed(colltaz) ;).
Done
This comment has been hidden.
You can assume that
n
is positive, i.e.,0 < n
.Haskell and CoffeeScript translations published.
JS translation kumited.
(Random tests added) more info on how to approve it ( or not )
I cannot accept your translation. I get a message saying something about recent changes that need to be merged first.
The message appears if the description has been updated since the translation got published. One can make a fork of the translation, update the description and the author can approve the fork instead.
I have already made the fork.
Thanks CrazyMerlyn, I have approved your fork.
This comment has been hidden.