6 kyu

Jumble words

140 of 288smolen
Description
Loading description...
Strings
Algorithms
Fundamentals
  • Please sign in or sign up to leave a comment.
  • Just4FunCoder Avatar

    This comment has been hidden.

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • ahmet_popaj Avatar

    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' """

  • user9644768 Avatar

    Ruby 3.0 should be enabled.

  • alxndrpi Avatar

    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.

  • zardoxnet Avatar

    This comment has been hidden.

  • mmalkavian Avatar

    If you reach 100% you will get a reward!

    Excuse me, I think I've missed this one; How do I check the percentage? and what was the reward?

  • aperezg Avatar

    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!

  • lechevalier Avatar

    This comment has been hidden.

  • lepton10 Avatar

    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.

  • anter69 Avatar

    Python test are totally screwed, this is a working solution at the moment:

    def jumble(string):
        return string
    
  • GiacomoSorbi Avatar

    And Ruby done too, cheers!

  • lechevalier Avatar

    Can you specify in the description that a word is defined as a group of alphanumeric characters only?

  • ChristianECooper Avatar

    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):

    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.
    Aridnoccg:to:a:reeceharsr:at:Crmdbigae:Uietvinrsy,:it:denos't:matetr:in:waht:oerdr:the:letetrs:in:a:wrod:are,:the:olny:ianrpotmt:thnig:is:taht:the:fsirt:and:lsat:lteter:be:at:the:rhigt:plcae.:The:rset:can:be:a:ttaol:mses:and:you:can:sitll:raed:it:wuitoht:plroebm.:Tihs:is:bucasee:the:hamun:mnid:deos:not:raed:eevry:leettr:by:iseltf:but:the:wrod:as:a:whloe.
    Arcnodicg:to:a:reecsarehr:at:Cdrgmbiae:Urtievnsiy,:it:dosen't:maettr:in:waht:odrer:the:ltteres:in:a:wrod:are,:the:olny:imnaprtot:tihng:is:taht:the:fsrit:and:lsat:ltteer:be:at:the:rgiht:plcae.:The:rset:can:be:a:tatol:mses:and:you:can:sitll:raed:it:whuoitt:prbleom.:Tihs:is:bsucaee:the:hamun:mnid:deos:not:raed:eevry:letter:by:itlesf:but:the:wrod:as:a:wolhe.
    

    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...

  • gabbek Avatar

    Great kata with a fun reward, good job! :)

  • zruF Avatar

    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

  • user5036852 Avatar

    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:

  • HerrWert Avatar

    It looks like I passed without accounting for punctuation at all. Shouldn't that have failed?