6 kyu
Inside Out Strings
1,045 of 1,958PG1
Loading description...
Fundamentals
Strings
Arrays
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.
C++ error "no matching function for call to 'insideOut'" -> should be insideOut(const std::string& x) instead of insideOut(std::string& x)
This one here was very challenging and a tricky one to solve.
Hi!
Concerning the tests in Python:
Is the following intended by the author
If not: Can the tests please be fixed so I can pass?
In this kata .. i learned there's a difference between s.split() and s.split(' ') .. it might help you..
C++ version generates warnings.
Fixed
'gfedcbanmlkjih cbadgfe abc a ihgfedcbarqponmlkj ihgfedcbarqponmlkj hgfedcbaiqponmlkj dcbahgfe abc jihgfedcbakutsrqponml hgfedcbaiqponmlkj hgfedcbaiqponmlkj edcbajihgf jihgfedcbatsrqponmlk abc ihgfedcbajsrqponmlk' should equal 'gfedcbanmlkjih cbadgfe abc a ihgfedcbarqponmlkj ihgfedcbarqponmlkj hgfedcbaiqponmlkj dcbahgfe abc jihgfedcbakutsrqponml hgfedcbaiqponmlkj hgfedcbaiqponmlkj edcbajihgf jihgfedcbatsrqponmlk abc ihgfedcbajsrqponmlk'
Where is the error?
There is a double space somewhere that's not shown there because you didn't use markdown formatting, read this: https://github.com/Codewars/Codewars.com/wiki/Markdown-Formatting
'ihgfedcbarqponmlkj ihgfedcbarqponmlkj edcbajihgf lkjihgfedcbaxwvutsrqponm gfedcbanmlkjih badc jihgfedcbakutsrqponml ab cbafed abc edcbajihgf' should equal 'ihgfedcbarqponmlkj ihgfedcbarqponmlkj edcbajihgf lkjihgfedcbaxwvutsrqponm gfedcbanmlkjih badc jihgfedcbakutsrqponml ab cbafed abc edcbajihgf' I think the test is not good. my code did the job as the instructions say
It's always a good idea to state which language you're doing the kata in. This one can be done in 8 different.
you are right. I did the kata in python
Check the answer to the post above yours.
Any idea what is going on here..i printed the test input and my program output. The program gives the expected results but the test actual does not contain my program output:
Test Results: Example_tests Log Input: man i need a taxi up to ubud output: man i ende a atix up to budu
Expected: equal to "man i ende a atix up to budu" Actual: "man i
I have same issue, C++
am i the only newbie here?
Easy but funny one.
I really enjoyed this kata, thanks for putting this together.
This comment has been hidden.
fixed
Quadraplet incoming !!!
Coffeescript translation
Crystal translation
Julia translation
Forked python with new test framework
Awesome work, all approved
In my humble opinion examples for kata must be create in more accurate and descriptive manner.
python: can anyone produce a shorter code than me? (in one line)
easy...
thx, needed to learn how it was done :)
C++ Translation
Good kata btw!
Thanks, approved
'hgfedcbaiqponmlkj kjihgfedcbavutsrqponml edcbafkjihg cbadgfe fedcbalkjihg badc ab gfedcbahonmlkji kjihgfedcbavutsrqponml kjihgfedcbavutsrqponml jihgfedcbatsrqponmlk' should equal 'hgfedcbaiqponmlkj kjihgfedcbavutsrqponml edcbafkjihg cbadgfe fedcbalkjihg badc ab gfedcbahonmlkji kjihgfedcbavutsrqponml kjihgfedcbavutsrqponml jihgfedcbatsrqponmlk'
Are my eyes failing me or are there typo's in the test scripts for Python? everything ok except that one 'extr'a space in the expected result...? (between "gfedcbahonmlkji" and "kjihgfedcbavutsrqponml", but somehow this "post" does not show the 2nd space here).
'dcbaeihgf edcbajihgf abc fedcbalkjihg gfedcbahonmlkji' should equal ' dcbaeihgf edcbajihgf abc fedcbalkjihg gfedcbahonmlkji'
A space in the beginning?
Let me check.
This is not correct because the result string has not been turned inside out. Please post your actual result so that I can tell if there is an issue.
from basic test. I did a print of input st and of my result respectively:
what time are we climbing up the volcano hwta item are we milcgnib up the lovcona
from the other test: (one that passed) (st)
abcdefghijkl abcdefghij abcdefghijklmnopqrstuvwxy abcde ab abcdef abcdefghijkl abcdefghijklmnopqrstuv abcdefghijklmnopqrstuvwx a abcdefghijklmnopqrs abcdefghijklmnopqr abcdefghijklmnop abc abcdefghijklmno abcdefghijklmnopqrstu ab abcdefghijklmnopqrstuv abcdefg abcdefghijklmnopqrstuvw abcdefghij abc abcdefghijklmnopqrs abcdefghijklmno abcdefghijklmnopqrs abcdefghijklm abcdefghijklmno
(output)fedcbalkjihg edcbajihgf lkjihgfedcbamyxwvutsrqpon baced ab cbafed fedcbalkjihg kjihgfedcbavutsrqponml lkjihgfedcbaxwvutsrqponm a ihgfedcbajsrqponmlk ihgfedcbarqponmlkj hgfedcbaponmlkji abc gfedcbahonmlkji jihgfedcbakutsrqponml ab kjihgfedcbavutsrqponml cbadgfe kjihgfedcbalwvutsrqponm edcbajihgf abc ihgfedcbajsrqponmlk gfedcbahonmlkji ihgfedcbajsrqponmlk fedcbagmlkjih gfedcbahonmlkji
(one that failed) (st)
(processed output)
@udovr use proper markdown so spaces can be seen.
believe it or not, but after the "baced" it still only shows 1 space with the 'special marking' backticks . and I can distinctively select 2 using the mouse when I edit the post... I think it's also safe to say that you can see that the whole "reverse" thing does it's work.
Use the multiline ones [```](https://github.com/Codewars/codewars.com/wiki/Markdown-Formatting#block-code-formatting)
ok, thanks Chrono79. done it for the failed one and yes, as you can see now, 2 spaces in the "expected" value, as opposed to just 1 space between the "processed" words of my code.
From what I can see, some input strings have more than one space between words in Python.
phew , so it's not me or my code and i'm not crazy ... :)
Fixed for both Ruby and Python; Haskell was unaffected. Please try and let me know.
@KenKamau, thanks, works now!
Now I can check the more genius approaches of this kata :)
Haskell translation
Please reivew and approve
Approved
Thanks. I will be on the lookout for issues.
Ruby translation
Please review and approve
Approved
Python translation
Please review and approve.
Also approved :)