6 kyu
Jumble words
140 of 288smolen
Loading description...
Strings
Algorithms
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.
This comment has been hidden.
python new test framework is required. updated in this fork
Can someone please expain me what the hex is this message error I am getting in Python?
""" Traceback (most recent call last): File "/workspace/default/tests.py", line 5, in validate("CodeWars",jumble) File "/workspace/default/preloaded.py", line 9, in val jumbled_words=findall("\w+",jumble(s)) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/re/init.py", line 216, in findall return _compile(pattern, flags).findall(string) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType' """
Ruby 3.0 should be enabled.
Can someone please point out to me, why I can't pass this test: Testing if the words, spaces and punctuation order has been respected for... and my jumbled text is:
Aodnirccg to a reerachesr at Cigbdarme Uitrvsneiy, it dnoes't mteatr in what oerdr the leertts in a word are, the only ioaptmnrt thnig is taht the fsirt and lsat letetr be at the rihgt palce. The rset can be a tatol mess and you can sitll read it wiothut pobelrm. Tihs is bcsuaee the hamun mind does not raed ervey lteter by ietlsf but the word as a wlohe.
This comment has been hidden.
It doesnt need to be in random fashion,words must differ from original thats all.Great solution anyway :)
Excuse me, I think I've missed this one; How do I check the percentage? and what was the reward?
I think your reward is nothing, but a comment here. Congratulations!
In JavaScript is an ASCII image you cannot really visualize properly and that I think will irritate some users.
hey but if you zoom out(using scroll) you can see whole image :P
Not immediate on a small screen and I am pretty confident I know which kind of user would rage about it...
Hello, I pass all the test except two and I don't understand why.
-> Testing if all the jumbled words have the same letters -> Testing if the words, spaces and punctuation order has been respected
The original text: According to a researcher at Cambridge University, it doesn't matter in what order the letters in a word are, the only important thing is that the first and last letter be at the right place. The rest can be a total mess and you can still read it without problem. This is because the human mind does not read every letter by itself but the word as a whole.
My Text: Anccordig to a reesearchr at Cgambride Utniversiy, it d'oesnt meattr in waht oerdr the lrettes in a wrod are, the olny inmportat tnhig is taht the fsirt and lsat leettr be at the rhigt pclae. The rset can be a taotl mses and you can sltil raed it wuithot peroblm. Tihs is bsecaue the haumn mnid deos not raed ervey leettr by iltsef but the wrod as a wlhoe.
The numbers of letters are the same, and spaces and punctuation order has been respected, anyone can you help me to see my error with my text?
Thanks!
Look at the apostrophe: he should stay there, like
deosn't
.Thanks!!
This comment has been hidden.
This comment has been hidden.
Yes, with the former, such solution is now expunged, thanks!
In python I am passing all of the test except one
Testing if the words, spaces and punctuation order has been respected for "According to a researcher at Cambridge University, it doesn't matter in what order the letters in a word are, the only important thing is that the first and last letter be at the right place. The rest can be a total mess and you can still read it without problem. This is because the human mind does not read every letter by itself, but the word as a whole."
My solution seems to have all of the required properties but still fails.
Ancordicg to a researcher at Cgmbridae Utiversiny, it dneso't mettar in waht oedrr the lrttees in a wrod are, the olny inportamt tnihg is taht the fsrit and lsat letter be at the rhgit pcale. The rset can be a tatol mses and you can slitl raed it wuthoit peoblrm. Tihs is bscauee the hamun mnid deos not raed erevy letter by ilsetf but the wrod as a wlohe.
Which test is it failing, now?
It passes all test except
Testing if the words, spaces and punctuation order has been respected for "According to a researcher at Cambridge University, it doesn't matter in what order the letters in a word are, the only important thing is that the first and last letter be at the right place. The rest can be a total mess and you can still read it without problem. This is because the human mind does not read every letter by itself but the word as a whole."
Even though I believe my answer reaches all the criteria
Hint: Be aware of apostrophes :)
I had the same issues, changed to code to leave all words which have apostrophes untouched and then past it, even though before, just like in your solution, the apostrophes were at the right location in my local tests.
Python test are totally screwed, this is a working solution at the moment:
It made me laugh so hard!
Ah, fuck me: to think this is the first test I wanted to implement and I forgot about it <_<
Fixed, thanks :)!
Edit: on second thoughts, that should have been fixed by my previous integration about 30 mins ago; maybe you just got them right before it, mh...
This comment has been hidden.
I really should be getting more sleep, lately T_T. Sorry again for the inconvenience, that is fixed!
More kata or more sleep, could be hard to choose one sometimes :')
So sad, so true T_T
And Ruby done too, cheers!
Can you specify in the description that a word is defined as a group of alphanumeric characters only?
Thats good idea!
Thanks for adding this explanation!
The Python tests are unreliable, though I'm not sure quite how, take a look at the following lines (I've substituted ':' for spaces for larity):
The first line is the original line, the second line failed the test, the third line passed the test.
As far as I can tell both lines pass the requirements, with the only difference being that the second line contains an unchanged word 'letter' (which is shuffled, but clearly the 't's and/or 'e's have swapped...
All other tests pass every time...
Well that's due to this condition in description, but I agree there is no reason to enforce it.
This comment has been hidden.
This comment has been hidden.
But how to discard solutions where someone just hardcoded and change one word?10% is still very small amount,in test cases there are alot of changeable words.
I have an idea, let me play with it...
Maybe fixed now :)
This comment has been hidden.
The way the random tests are computed makes extremely unlikely that you get a string of (minimum) 5 words which are all non meaningful for testing purposes, doesn't it?
1/6000, it's not that impossible ;-)
The
doesn't
->denos't
is legitimate though -doesn't
is a single word.Yes, it is a contraction of "does not" which is two words, but it is a single word with an apostrophe embedded in it.
I'm not a linguist, or etymologist - but this is what I was taught at school many (many, many) years ago. :)
You are totally right, that's why I suggested at
@smolen
to add the following definition for this kata purpose ;-)Cool, you might want to change that to something a little clearer like:
punctuation is considered a word boundary (i.e. "doesn't" is two words "doesn" and "t").
Note that the complete description is now:
@ChristianECooper
,Thanks for pointing this out, I just got stuck thinking
doesn't
was a single word too!Great kata with a fun reward, good job! :)
Hey, I got some problem with this kata. The example test works perfectly with my solution, but none of the random tests passes. I excluded punctuation marks and I only changed the inner part of a word. I get the following error:
First and last character in the word cannot be changed
example:
terrific river boy curvy tame! notice gamy squeal
my output:
teirifrc reivr boy curvy tema! nciote gamy sqeual
can you post your solution?
This comment has been hidden.
Oh well. I didn't include ! and ? in my regex :D Let my try this out.
Edit: Okay, worked :) Nice Kata, btw! I enjoyed it.
You were faster than me!:D Good job!
Thanks for approving kata :).
Similiar to my new kata https://www.codewars.com/kata/srot-the-inner-ctonnet-in-dsnnieedcg-oredr
Two guys, one good idea! :-)
Similar to my kata, but with a very own character. Really good kata! Thanks, smolen! :-) Great job! :thumbsup:
Thanks Steffen!It was random idea to make this kata when i saw the article :P. I have solve your kata too!+1
It looks like I passed without accounting for punctuation at all. Shouldn't that have failed?
Punctuation is not a part of a word.You must only mix words. I have update tests now,thanks for pointing that out!
No problem! And now I went back and redid my solution. It was a fun challenge! Nice kata!