7 kyu
Switcheroo
6,983 of 18,096PG1
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.
No random tests in Java
TypeScript translation
Approved
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Approved, thanks
I'm doing this one in Ruby. Random testing always fails but when I test the case myself (as a fixed test), it works. Seems to have happened before. Any fixing?
You should read this: https://docs.codewars.com/training/troubleshooting/
Lua translation!
Approved, thanks
Thank you!
No probs - feel free to transalte as many of mine as you want. If you have any outstanding tag me in them too - its hard to keep track on here sometimes.
Please review and approve, thanks !
Approved
Factor translation
Approved
D translation
You're on fire - approved
Rust translation ready for review
thanks, language version showing as invalid
Needs an update to be approved
Beware, some suggestions have been made in the discourse of this translation, don't approve it too hastly.
@PG1: rust version updated
R translation
Approved
Java is missing the class declaration
In case someone wonders how to fix the problem: Just add a class with any custom name.
public class Switch{
public static String switcheroo(String x){ return "code"; } }
Fixed. Thanks!
string
should not be used as parameter name (Python)Can you approve this fixed python version ?
DOne
This comment has been hidden.
C++ translation kumited
Approved
Coffeescript kumited :) please review and approve ~~
Approved
Ruby testing incorrect. Please fix
Testing for baaacaccccba It should work for random inputs too - Expected: "baaacaccccba", instead got: "abbbcbccccab" Testing for caabbbbbacacbccaab It should work for random inputs too - Expected: "caabbbbbacacbccaab", instead got: "cbbaaaaabcbcaccbba" Testing for accabaa It should work for random inputs too - Expected: "accabaa", instead got: "bccbabb"
Clojure Translation ready for review
You're smashing these translations :D - approved
Forked python translation with new test framework used and 3.8 enabled ~~
Groovy translation kumited. Please review and approve. Thanks, suic
Thanks suic, approved
Julia translation
Approved
Haskell : https://www.codewars.com/kumite/5ba85196fe6c0c698e000104?sel=5ba85196fe6c0c698e000104
Approved
test cases is bugged, need fixing:
Random tests Testing for abbcbcaaab ✘ It should work for random inputs too - Expected: "abbcbcaaab", instead got: "baacacbbba" Testing for baaaabb ✘ It should work for random inputs too - Expected: "baaaabb", instead got: "abbbbaa" Testing for caccbcbbbbaa ✘ It should work for random inputs too - Expected: "caccbcbbbbaa", instead got: "cbccacaaaabb" Testing for aacaacb ✘ It should work for random inputs too - Expected: "aacaacb", instead got: "bbcbbca" Testing for accbc ✘ It should work for random inputs too - Expected: "accbc", instead got: "bccac" Testing for cbbbcbbac ✘ It should work for random inputs too - Expected: "cbbbcbbac", instead got: "caaacaabc" Testing for acaaaabcabbbaccbcaab ✘ It should work for random inputs too - Expected: "acaaaabcabbbaccbcaab", instead got: "bcbbbbacbaaabccacbba" Testing for bacacbbb ✘ It should work for random inputs too - Expected: "bacacbbb", instead got: "abcbcaaa"
Hi, which language?
ruby
test cases is bugged, need fixing:
Random tests Testing for abbcbcaaab ✘ It should work for random inputs too - Expected: "abbcbcaaab", instead got: "baacacbbba" Testing for baaaabb ✘ It should work for random inputs too - Expected: "baaaabb", instead got: "abbbbaa" Testing for caccbcbbbbaa ✘ It should work for random inputs too - Expected: "caccbcbbbbaa", instead got: "cbccacaaaabb" Testing for aacaacb ✘ It should work for random inputs too - Expected: "aacaacb", instead got: "bbcbbca" Testing for accbc ✘ It should work for random inputs too - Expected: "accbc", instead got: "bccac" Testing for cbbbcbbac ✘ It should work for random inputs too - Expected: "cbbbcbbac", instead got: "caaacaabc" Testing for acaaaabcabbbaccbcaab ✘ It should work for random inputs too - Expected: "acaaaabcabbbaccbcaab", instead got: "bcbbbbacbaaabccacbba" Testing for bacacbbb ✘ It should work for random inputs too - Expected: "bacacbbb", instead got: "abcbcaaa"
Either the description isn't clear enough or I'm just interpreting this wrong. I interpret this as "Given a string, replace all instances of 'a', with 'b', and all instances of 'b' with 'a'".
I'm printing the input for each test and see some odd behaviour. For the input "bcaccbb" in one of the test cases, it expects this same value back. Instead, shouldn't it expect "acbccaa". Rather it's expecting "bcaccbb" to be returned. I'm doing the Ruby version.
It seemed fine to me with a simple swap.
Hold my kata, I'm going in!
This comment has been hidden.
I just ran the same and it passed?
Python translation just dished, enjoy!
Approved
C#-Translation kumited!
https://www.codewars.com/kumite/57f778ef8b0760fe0f0000f6
Please check and approve it! ;-)
Approved :D
Upvoted (+1) Have a good day!
Thanks Raul :D