6 kyu
Look and say numbers
1,764 of 2,639Svenito
Loading description...
Recursion
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.
Haskell translation
JS fork 🤖
mocha/chai
deep assertions (resolving this issue) +lodash
for randomnessMerged
🔍 An Interesting Find!
A few days ago, I solved a problem very similar to this one!
🔗 Link: Check it out here
🤔 Question: Is there a way on Codewars to determine which of these two problems was created first?
look at the bottom of the page on a
https://www.codewars.com/kata/{kata_id}
URL. there are statistics there📌 An Interesting Discovery
It looks like this problem was designed about three years earlier than the link I shared. 🤔
There’s a chance that the other one is a copy of this, but either way, I really enjoyed solving it—even the second time! 🚀
🔍 Can We Trace the Original Idea?
Is there a way to determine which user originally came up with an idea for a problem?
That would be really interesting to know! 💡
when retiring duplicate katas, it is irrelevant to know which one is the older. things to consider are the quality of each one (random tests' coverage, better design / interface, description, etc.). There is a github repositery where duplicate katas (and other content issues) are handled. you can open a new ticket there about that one. you can also vote and comment on other similar tickets.
Wow! That was really interesting!
What Valuable Information You Gave Me! 🚀🎉
Please help me on this. I don't even know where to start.
Pick an easier kata? There's plenty of 8/7 kyu katas for you to practice to help you level up and tackle this one (later).
I have to earn 20 points in honor before it allows me to save problems to revist. Thanks for the advice! I'll do just that.
You have your browser's history for that. Also, you can visit your profile to see "unfinished" katas list.
Focus on learning fundamentals to solve simpler problems, and in a week, you'll likely be able to come back and solve this one (and many more) too.
python new test framework + random tests are required. updated in this fork
Approved
This comment has been hidden.
Now there are random tests in Python to say the least !
D translation
how's this for 6 kyu i didn't understand anything except first line lol
Because the community decided so, and IMO the ranking is perfectly fine for this one!
COBOL translation, including random tests (author inactive).
approved
brutal.... would you guys judge me if i used itertools....
Nice kata.
Node 18. should be enabled
assert.deepEqual
should be usedMerged a fix for these.
This comment has been hidden.
Typescript and Julia translations.
TypeError: Cannot read property 'join' of undefined at /home/codewarrior/index.js:19:36 at /home/codewarrior/index.js:23:5 at Object.handleError
Your function has no return statement, maybe.
thanks
'join' is a method on an array object. You are not returning an array, so no .join method exists.
Added random test and approved Ruby version.
It is showing error in test cases for join. I am not able to return anything.
No random tests.
Fixed for JS
All languages now have random tests, closing.
This comment has been hidden.
.
Added javascript translation.
While it's implied, the instructions aren't very clear that the first argument can be anything other than "1". Instead of this:
Write a function that given the starting value '1' (as a string) returns this sequence as a list.
You might want to consider saying something more like this:
Write a function that, given a starting value (as a string), returns the appropriate sequence as a list. The starting value '1' returns the above sequence.
Quite right. It does sound like it should always be '1'. Updated description as suggested.
In the description, the last line reads "1112213211" but should read "1113213211", where the fourth digit is a 3 instead of a 2
Thanks for pointing that out. Updated with the correct line
I don't understand what the Variation Rules it is behind those sequence of numbers.
Pretend you are reading a long number to someone over the phone simply. Like "Yes, it's one one, two twos, one nine." Which would be 112219 in this sequence. And then read THAT number to someone. So it's "Two ones, two twos, one one, one nine."
It is not recommended to use a mutable data type such as a list as a default argument in python. It is also not very pythonic to send a
result
parameter that should be appended to. Instead, you generally see functions that return a list instead of modifying one passed in to it.I've changed the requirements so that the resulting list should be returned from the function.
This comment has been hidden.
Thanks, that helps. So basically just pass the list to process and append to it each recursion?
And yes, the test isn't great.
I've updated it, please confirm it's an improvement.
Thanks
Updated kata to fix issues