:There are many errors in the solution to the last sample, indicated by '*':
"you've gotta dacne like teehr's nbdooy wachintg, love like ylo'ul neevr be hrut, sing like teehr's nbdooy leiinnstg, and live like it's haeevn on earth."
* * * * * * * * * * *
It would be nice if there was an additional test case that deals with words that have both a leading/trailing special character and an internal special character. None of the current test cases deal with this scenario but it comes up in the random tests.
I had the same problem:
Try to refactor your code and remove any mutating method that you called on the object referenced by the input string.
Use non-mutating methods instead and try again.
Hope this works!
This test failure is a bit confusing to me, given that the kata description requires that we keep the punctuation in its original location, which is opposite to what this expected value would suggest. It looks like these 'random value' test cases are expecting all the punctuation to be deleted.
Are we supposed keep punctuation in its original location in some situations, but not others?
I'd love to know if there's something obvious I'm missing in my understanding of the problem so I can solve the problem properly. Thanks! :)
TEST:
"Testing for "you're codewars blink, eat jiggery-pokery callipygian four dice in"
It should work for random inputs too -
Expected: "yorue cadeorws bilnk eat jeeggikoprryy caagiillpyn four dcie in",
It's it not possible to use the string.matchAll function in this compiler? I got "TypeError: word.matchAll is not a function" when calling a matchAll function. It's kinda tricky.
This comment is hidden because it contains spoiler information about the solution
Seems correct to me. ex "love", first letter "l" and last letter "e" dont change, "ov" sorted alphabetically is, well, "ov".
:There are many errors in the solution to the last sample, indicated by '*':
Done for Python.
Great kata!
in the following test cases:
scramble_words('-dcba') == '-dbca'
as first char is "-" and last "a", shouldn't return value be "-bcda"?
scramble_words('dcba.') == 'dbca.'
as first char is "d" and last ".", shouldn't the return value be "dabc."?
Since the first and last characters remain in original place for each word. Thanks for any clarifiaction.
It would be nice if there was an additional test case that deals with words that have both a leading/trailing special character and an internal special character. None of the current test cases deal with this scenario but it comes up in the random tests.
I had the same problem:
Try to refactor your code and remove any mutating method that you called on the object referenced by the input string.
Use non-mutating methods instead and try again.
Hope this works!
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)
Nice kata:)
This test failure is a bit confusing to me, given that the kata description requires that we keep the punctuation in its original location, which is opposite to what this expected value would suggest. It looks like these 'random value' test cases are expecting all the punctuation to be deleted.
Are we supposed keep punctuation in its original location in some situations, but not others?
I'd love to know if there's something obvious I'm missing in my understanding of the problem so I can solve the problem properly. Thanks! :)
TEST:
"Testing for "you're codewars blink, eat jiggery-pokery callipygian four dice in"
It should work for random inputs too -
Expected: "yorue cadeorws bilnk eat jeeggikoprryy caagiillpyn four dcie in",
instead got: "yor'ue cadeorws bilnk, eat jeeggik-oprryy caagiillpyn four dcie in" "
Thanks PetrSr!
The maximum version of Node.js available in codewars is currently 10.x. matchAll support was only added in Node.js v12.0.0.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll#Browser_compatibility
It's it not possible to use the string.matchAll function in this compiler? I got "TypeError: word.matchAll is not a function" when calling a matchAll function. It's kinda tricky.
Loading more items...