7 kyu
Thinking & Testing : Incomplete string
517 of 1,562myjinxin2015
Loading description...
Puzzles
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.
Nice one. Enjoyed it. 6 kyu IMO
I couldn't do it. I looked at the solutions and here are my feelings:
"I do not know what to smoke to come up with such a task" LOL
The rank of 7 is the first clue that whatever mystery code for transforming input to output will not be particularly complex. I looked for low-hanging fruit, and there it is. If you want to re-calibrate your horrible-ometer, try some Bongard Problems. The point is to figure out what all the things on each side (left or right) have in common, and what and how that makes them different from / opposite to all the things on the other side. gl hf
JavaScript fork (author inactive)
Approved!
function testit(s){ //return s; //return s.substr(0,1); switch(s.length) { case 0: return ""; break; case 1: return s; break;
default: let array = []; let charArray = []; for (let iterator = 0; iterator < s.length; iterator ++) {
if(iterator % 2 == 0) { charArray = []; } charArray.push(s[iterator]);
if(iterator % 2 == 0) { array.push(charArray); } }
}
function getcharacter(Strings = [[]]) { let retorno = ""; Strings.forEach(value => retorno += value[0]); return retorno; } /author: return ???; me: Let's see how this goes/ }
Don't believe those who say it's a hard kata. It's a decent one for 7 kyu, but!
The main point you should not guess beforehand, make the simplest assumption and check it. Third assumption should be right (but there's one small catch).
So we can say this kata doesn't presume any deep knowledge, but presumes logical approach. You should make one small guess at a time to finish it without any problems or a lot of pain. So I am thankful to author that he reminded me of importance of being humble.
This comment has been hidden.
The sooner you unlock this kata, the faster the headache ends.
After reading that abab should return aa and acac should return bb I knew it is some crazy logic with ascii. I unlocked the solutions and even though I know what I should see in them, it's still too complicated for 7kyu.
This comment has been hidden.
C translation
approved
Wow. That was very satisfying. Thanks. Now I need more katas like this.
This comment has been hidden.
No they don't, and submitting such code is a quick way to get yourself banned.
.
Nice and fun as always from the author but you have to run the full tests to see the pattern.
I solve all of 1000+ level 7 katas as entertainment. Your tasks are disgusting for level 7.
Python new test framework should be used (Refer this & this for more detail)
Ruby 3.0 should be enabled (Refer this & this for more detail)
Done for Python.
its a 6.5 kyu not 7))))))
Most of these
Thinking & Testing
katas differ in difficulty across available languages because some test suites run all random tests before failing while other don't creating a gap in information accessible to user.Nice!
nice one :-)
How is this working? I click each "question" but nothing happens...
I don't met with author that sirie but he is crazy))))
riddle?
The current sample tests are absolutely useless for determining the
input -> output
relation. The only way to solve the task is to attempt with an empty function to see any meaningful examples.Anyway, 446 people solved it. ;-)
But that doesn't change the fact that sample test are bad. I've done all
7 kyu
"Thinking and testing" katas, and in most cases I could notice the pattern just by looking at the sample tests. While here attempting the final tests is obligatory to get some minimal insight in what is going on. And even then the strings are something like 20+ characters long, and noticing the pattern is hard.Short and simple tests like
Test.assertEquals(testit("ac"), "b")
orTest.assertEquals(testit("aebc"), "cb")
are a must-have.Yea, my code passed all the sample tests...but doesn't work because I couldn't see the rest of the tests.
@FArekkusu comments help me alot! Thanks!
Ha, ha, I wrote solutions like a dozen lines of code which were working for most of the examples.
Happy coding
^_^
Aaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhh!
Wwwwwwwwwwwwoooooooooow!
got it. knew it couldn't be too convoluted since it's an approved kata... good one :)
I have a nice hint for this one, that really helped me to crack it - without revealing too much, that is "look for repeating characters in the expected results". I mark it as a spoiler, but @myjinxin2015 if you think it's worth it, you can add it to the description.
kata hint != kata suggestion
In Java
Log: s = "z" s = "jdrujznvaf"
expected:<[gsrrc]> but was:<[jdruj]>
*Random test
Mistake?
the java translation published 1 year ago, and 45 warriors submitted their solutions ;-)
seriously, 7kyu...? x/
Poor myjinxin, the world is so unfair... ;o
I learn so much from solving your katas, myjinxin2015. Thanks.
Happy coding
^_^
These "guess what it is" challenges are nasty. Those who think they're as easy as other 7 kyu katas - beware!
Yep. It's easy to code once you know the answer, but you have to figure out the answer...
finally i cracked it..
C++-Translation kumited.
Please check it and approve. Thanks! ;)
Haskell translation.
Approved, thanks ;-)
I'm shocked this one was ranked 7 kyu. I wouldn't expect novice developers to pick up on this that well. I think its at least 6 kyu.
Do you see my reply in other kata?
Copy it to here:
Hi,jhoffner
Since today, I can not submit solution in all katas. I got an error like this:
The error occurred in the chrome core browser(I try with three kind of browsers).
I try in Firefox, no problem
In the edit interface of Kata, click Validate Solution no response (in chrome core browser)
I haven't the slightest idea what's going on x)
I'm glad i saw the solutions instead of getting frustrated for no reason ...
What kind of fiendish mind thinks up this stuff?!
This one was more difficult than the others IMO but that only made solving it more satisfying.
;-)
Ruby kumited.
Java kumited.
This comment has been hidden.
;-)
This series is amazing! I love it :)
I figured it out because of your comment, thanks!
not fair, some warriors had an unfair advantage because they were able to see that comment. reveal it once again!
WTH This is soo tough :'( I can't even guess the solution in a million years. Is there a thinking process which will help me solve the katas of this series?
PS - I wouldn't haved ranked your katas at 7kyu.
Hmm...sorry! It seems that you do not adapt to this Kata form, I recommend to you the other two kata: http://www.codewars.com/kata/56cd5d09aa4ac772e3000323 http://www.codewars.com/kata/56c85eebfd8fc02551000281 They have a detailed description of the kata, and there are innovative and interesting I hope you can enjoy