7 kyu
Reversed Message
759EmilyScripts
Loading description...
Fundamentals
Strings
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.
Python Translation
JavaScript fork
Fixing the issue I raised and updating to node 18
Approved
Damn you fast
JS - random tests can generate "0-length words" leading to words separated by more than 1 space.
Possible solutions:
.
I've passed all tests. Also i passed random tests but i got an error "Cannot read property 'toUpperCase' of undefined". How it can be?
In what language?
JS - random tests can generate "0-length words" leading to words separated by more than 1 space. I think that such inputs shouldn't be tested, but I haven't checked other languages.
With JS. I tried to split with regexp. But it doesn't work. Very strange.
Unfortunately, your new approach runs into a different problem - it consumes all extra spaces between words, which differs in behaviour from the reference solution.
I think this can be considered a kata issue, and it should be either specified in the description, or not tested at all (I prefer the latter option).
I guess a third option can be considered: retire the kata. I'm pretty sure it's a duplicate and it's only available in JS, so not much would be lost.
JS: Node v12 should be used along with the appropriate assertion tools (Mocha + Chai)
JS I pass all the intitial tests. I've filtered out 'words' with spaces but I only pass about 2/3's (on average) of the main tests. I've looked at a couple of the failed tests and if there are any differences between my result and the provided solution, they are not visible to the naked eye - so invisible characters perhaps... Anyone have any clues?
Now that this kata is approved, it needs random tests.
resolved
Thank you, I have been trying to sort this but couldn't get it to work correctly
How can I see all the tests? I've passed tests. But the result of full tests is "Cannot read property 'toUpperCase' of undefined". I can't get why:(
Hi I moved the tests over into the example tests so you can see what's exactly being tested. I've tried to work out what causing your problem but I cannot figure it out so just thought I'd give you a short term solution for the time being
Thanks. I stuck on this test: Test.assertEquals(reverseMessage(''),''). But i've already solved this problem
How did you do that?
Hi, I split the string into an array using space as a separator. Then I used the filter() method to get rid of all the empty strings in my array. I carried out all the other operations with the array returned by filter() method. I can't disclose my code here because it will be a spoiler
Needs random tests
resolved
!atak Tsrif Ruoy No Snoitalutargnoc
Thank you :)