6 kyu

Split Strings

54,909 of 165,458jhoffner
Description
Loading description...
Regular Expressions
Strings
Algorithms
  • Please sign in or sign up to leave a comment.
  • SamCorz12893 Avatar

    hi everyone, i'm new to coding, and i'm stuck on this kata. I've tried slicing, appending, performing inplace modifications and for some reason i cannot manage to get an underscore added to the last index of an odd number of string. Can anyone give me advice or know how i can fix this problem. I'm really close to solving it, the underscore just always appears as a different index instead of being included in the last existing one already.

  • Dramos_III Avatar

    This comment has been hidden.

  • tubustubus Avatar

    Is there a specific method we should use? All logs seem same as answer, but the test said they were all wrong

  • seriyseriy Avatar

    This comment has been hidden.

  • gantabya007 Avatar

    This comment has been hidden.

  • NasifAkeemOmosanya Avatar

    This comment has been hidden.

  • Sayed Naveed Avatar

    This comment has been hidden.

  • kaz1nak Avatar

    i hochu piccy rebyata

  • yargrand Avatar

    good problem for practice

  • aligan89 Avatar

    Why did no one account for multibyte strings? Poor form?

  • sdasda744 Avatar

    I did the task like this:

  • UhhRobin Avatar

    this one was very very hard! its impressive to see how much better everyone is able to do these :P

  • RB2000 Avatar

    This comment has been hidden.

  • CClairvoyant Avatar
  • Fazal Sultan Avatar

    I know this point is not mentioned in Question, but will handle the case if in the input string we have spaces i,e("never give up") ?

  • Uncle._.Shrimp Avatar

    In C++ gives error message "split_strings -> empty_string" which, what I thought, means that my code's answers are wrong meanwhile in all tests I did, empty string returns empty string which should be the correct answer.

  • Raul_Arce Avatar

    This comment has been hidden.

  • trashy_incel Avatar

    the testing code should be moved from preloaded to tests in C++

  • trashy_incel Avatar

    in Java, assertArrayEquals should be used instead of stringifying the arrays, which produces confusing assertion messages

  • csminb Avatar
    solution("BlTWkPaAOEjPacvPtykgCOTzDXNevA")
    expected: ["vA"]
         got: ["Bl", "TW", "kP", "aA", "OE", "jP", "ac", "vP", "ty", "kg", "CO", "Tz", "DX", "Ne", "vA"]
    

    i'm assuming the test cases are incorrect? (ruby)

  • Cypholexias Avatar

    This comment has been hidden.

  • onlynan Avatar

    This comment has been hidden.

  • Accel.R Avatar

    This comment has been hidden.

  • GabrielGSRosa Avatar

    This comment has been hidden.

  • iqbalmdev Avatar

    This comment has been hidden.

  • KS-SenkuFan Avatar

    anyone got any idea how they would use itertools to solve this? btw for python 3.10 pls

  • andrews.ntt Avatar

    Code ran with warning on local and online compiler with Clang++8.0.1 (was Clang++ freaks out), but that was enough to be treated by Codewars as an error:

    In file included from main.cpp:6: ./solution.cpp:16:7: warning: variable 'i' is incremented both in the loop header and in the loop body [-Wfor-loop-analysis] i++; ^ ./solution.cpp:12:35: note: incremented here for (int i = 0; i < s.size(); i++) { ^ ./solution.cpp:12:23: warning: comparison of integers of different signs: 'int' and 'std::__cxx11::basic_string<char, std::char_traits, std::allocator >::size_type' (aka 'unsigned long') [-Wsign-compare] for (int i = 0; i < s.size(); i++) { ~ ^ ~~~~~~~~ 2 warnings generated. /tmp/main-1368cb.o: In function do_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)': main.cpp:(.text+0x15): undefined reference to solution(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)' clang: error: linker command failed with exit code 1 (use -v to see invocation)

  • IwyssonN Avatar

    This comment has been hidden.

  • lince0xA Avatar

    This comment has been hidden.

  • KaraWatts Avatar

    This comment has been hidden.

  • Regedor Avatar

    This comment has been hidden.

  • econscript Avatar

    why do we have to return an empty array if no string is given?

  • cMardc Avatar

    Writing in C++, i got an error on tests:

    even_length
      Expected: [ "ab", "cd", "ef" ]
      Actual: [ "a
    odd_length
      Expected: [ "ab", "cd", "e_" ]
      Actual: [ "a
    

    This error messages are invalid. Even if my code was wrong, it's not possible to send an array/string without closing symbols : quote and brace.

  • shahed.hussain Avatar

    This comment has been hidden.

  • saudiGuy Avatar
  • MKDavids Avatar

    This comment has been hidden.

  • BlakeS-Byte Avatar

    In c++ when using to add the "" to an odd length if(l%2 == 1) temp += ""; split.push_back(temp);

    the output doesn't reflect the concatination, tested it in vs code and the output matched, not sure what is happening

  • BetulZora Avatar

    I've forgotten how tricky basic Java tasks are. It took many attempts of going back and forth, trying to understand why it would not recognize the last pair and add the underscore. Good test. Enjoyable once you solve it.

  • xyzf00 Avatar

    Weird test error expected [ 'ab', 'cd', 'ef', 'f_' ] to deeply equal [ 'ab', 'cd', 'ef' ]

  • Aeth-Z Avatar

    This comment has been hidden.

  • Haruncelik96 Avatar

    This comment has been hidden.

  • cleorodrigues21 Avatar

    hello, this is not accepting single quotes, always putting a slash in front, can anyone help me?

  • Fonstw Avatar

    This comment has been hidden.

  • Anivaries Avatar

    Is something wrong with tests on this one? My code works perfectly fine when i run it in VS Code but it shows only errors when i run tests here

  • pewdro Avatar

    nice kata :)

  • frankie79bc Avatar

    Another Kata that works perfectly on VS code and XAMPP and fail TEST/ATTEMPT here...i Wrote this code three times and yet, it works locally but is not accepted on this platform...

  • Msoddy Avatar

    In Java, I think the testing criteria are off for the odd strings.

    "Should handle odd string expected:<[ab, [cd, ]e_]> but was:<[ab, []e_]>"

    I think the brackets are breaking it, and I couldn't get my code to read the expected output, because it would wind up as "[ab, [c, d], e_]" even if it took the brackets into account. Am I messing up though?

  • Xros22 Avatar

    First rate coding exercise

  • danlongname Avatar

    I'm using ruby and when I click on attempt, the 100 random tests can never be fulfilled.

    First, it will return an error saying it was expecting an empty array on a random string.

    The exercise shows that when a string isn't empty, it should split it normally and return an array with the characters.

    If you instead make that so only the example strings pass and every other random string returns an empty array (as it seemed that the attempt required), it shows a completely different scenario, where it expects the code to run normally.

    So you can never have the 100 random attempts to work.

  • avichii Avatar

    it was cool, its been a while since the last time i used window funciton.

  • SenorGato Avatar

    In golang the tests are wrong:

    Expected <[]string | len:6, cap:8>: ["a", "b", "b", "c", "c", ""] to equal <[]string | len:2, cap:2>: ["ab", "c"]

    It does not say anything about ignoring duplicate charachters in the description so the solution should be ["ab", "bc", "c_"] yet it returns fail on that response.
    
  • rawan2088 Avatar

    This comment has been hidden.

  • dev0652 Avatar

    There seems to be a mistake in random tests when you hit "Attempt"

  • lash347 Avatar

    This comment has been hidden.

  • Scho-ju Avatar

    (Ruby)

    I had an issue with the random tests. It seem to expect "__" on even numbers of characters

    Test Passed: Value == ["pX", "yg", "mY", "vO", "zr", "gm", "wC", "Yb", "U_"]

    Expected: ["SH", "Kt", "rj", "QZ", "Lb", "QJ", "yd", "Ma", "La", "__"] instead got: ["SH", "Kt", "rj", "QZ", "Lb", "QJ", "yd", "Ma", "La"]

  • RoyalInTheNight Avatar

    This comment has been hidden.

  • inilim Avatar

    This comment has been hidden.

  • itsAdiz Avatar

    This comment has been hidden.

  • codesilas Avatar

    Why if the string is "asdfadsf" the output shows: None should equal ['as', 'df', 'ad', 'sf'] ?

  • Doug Colin Avatar

    (Javascript)

    The first time I solved this kata, there was a strange sample test that may be some sort of error.

    The test was for input "C". Output was ["ab", "cd", "ef", "g_"]

    I wrote a if statement that returned that output for input "C", and it passed.

    I went back to the kata just now so I could copy the sample test and list it here, but now the sample test isn't there. Not sure how this happened or how rare it is, but I figured it's worth mentioning.

    Otherwise, thanks for the fun kata.

  • g3th Avatar

    In C++, my code makes use of size() in the algorithm's iterations' comparisons, push_back() to append to vector and substr to iterate through given string indexes.

    All test cases work, and more test cases work as well, appending the character "_" to uneven strings.

    The compiler returns:

    '''In file included from main.cpp:6: ./solution.cpp:14:23: warning: comparison of integers of different signs: 'long' and 'std::__cxx11::basic_string<char, std::char_traits, std::allocator >::size_type' (aka 'unsigned long') [-Wsign-compare] for (long int x=0; x < original_string.size(); ++++x){ '''

    I suggest you fix your site to support modern versions of the language.

  • spencerhill97 Avatar

    Pretty lost here with what's wrong. New to the site and I've passed the test, but when I hit attempt it says that I've failed one random test. Can anyone help here.

    expected [ 'UI', 'Dz', 'Eu', 'Og', 'rs', 'u_', 'mG', 'Uk', 'sw', 'qZ', 'kM', 'u_' ] to deeply equal [ 'UI', 'Dz', 'Eu', 'Og', 'rs', 'uU', 'mG', 'Uk', 'sw', 'qZ', 'kM', 'u_' ]

  • Godwin Bassey Avatar

    NameError: name 'solution' is not defined

    I keep getting this error 👆👆👆. I'd like to know why

  • MrTarantin Avatar

    /tmp/main-a218bf.o: In function do_test(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)': main.cpp:(.text+0x15): undefined reference to solution(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)' clang: error: linker command failed with exit code 1 (use -v to see invocation)

    get this error... have no idea what to do... hewp me (^-_-^) checked my solution in VStudio and everything is working perfectly fine

  • transan Avatar

    Just passed in Python, thanks for this kata

  • Pilopede Avatar

    This comment has been hidden.

  • tri@ Avatar

    This comment has been hidden.

  • Islam-foda Avatar

    This comment has been hidden.

  • yAwdniK Avatar

    This comment has been hidden.

  • KayleighWasTaken Avatar
  • maffin immortal Avatar

    Who can explain me this error:

    expected [ 'HK', 'KL', 'MU', 'VY', 'ab', 'eg', 'jn', 'no', 'pq', 'tv' ] to deeply equal [ 'Mq', 'Kb', 'aj', 'pV', 'nv', 'Kg', 'Yn', 'Uo', 'He', 'Lt' ]

    My function return [ 'HK', 'KL', 'MU', 'VY', 'ab', 'eg', 'jn', 'no', 'pq', 'tv' ] and I think it's right because it's normal sort by alphabet.

    I don't understand how we can get [ 'Mq', 'Kb', 'aj', 'pV', 'nv', 'Kg', 'Yn', 'Uo', 'He', 'Lt' ] when we sort by alphabet

  • Wadsworth27 Avatar

    Honestly way too easy for 6.

  • sinner933 Avatar

    This comment has been hidden.

  • sinner933 Avatar

    This comment has been hidden.

  • YaroslavBaienko Avatar

    This comment has been hidden.

  • Aymane111 Avatar

    is something wrong with the single quotes ? my code returns exactly the same array as the one expected but still fails the test

  • b0bby92 Avatar

    This comment has been hidden.

  • user5763476 Avatar

    nice exercise :)!

  • Meg-Div Avatar

    Got this fun error from a do/while loop 'UndefinedBehaviorSanitizer: nested bug in the same thread, aborting.' Switched it to while loop and it passed.

  • RGgg Avatar

    Does anyone know why it doesn't pass the test? Test Results: Example Tests Log ['as', 'df', 'ad', 'sf'] None should equal ['as', 'df', 'ad', 'sf']

  • roket_v Avatar

    This comment has been hidden.

  • ChoLone Avatar

    I find out that's replaceAll() still not support :(

  • akar-0 Avatar

    COBOL translation + description updated to be language agnostic according to official recomendations (it includes a codeblock for C with specific instructions, but there is no C translation currently available nor pending approval... However this note would fit better in solution set up).

  • Puneet1998 Avatar

    This comment has been hidden.

  • Khryplyvyy Avatar

    This comment has been hidden.

  • Wail45 Avatar

    This comment has been hidden.

  • red_grave Avatar

    This comment has been hidden.

  • amadeusb4 Avatar

    This comment has been hidden.

  • fernandogrmz Avatar

    This comment has been hidden.

  • DSTGU Avatar

    This comment has been hidden.

  • QCassass1 Avatar

    This comment has been hidden.

  • FettahAud Avatar

    This comment has been hidden.

  • NargizHasanova Avatar

    This comment has been hidden.

  • KappaKoppa Avatar

    This comment has been hidden.

  • ABDELADIM Avatar

    This comment has been hidden.

  • ahtaum Avatar

    i have returned empty value if the input is empty in array but still error like this : null does not match expected type "array".

  • Nobuto11 Avatar

    This comment has been hidden.

  • IsekaiGuy Avatar

    I don't like this kata(JS). It's all about crazy examples of regular expressions. How do people come up with such? How long should you practice RegExp's to write them? It's just a 6 kyu, remember?

  • RazorLake Avatar

    Man... This is just confusing as hell. I've been programming with C++ for the past several months and this is the first english website I used and this question has me completely mistified. I never used anything like this, only the console on CodeBlocks to solve problems. At least this humbled me a bit, heh

  • sachinkhatri Avatar

    Everthing works on IDE with same data as full suite test. But is giving wrong output here for [].

    IDE(Intellij) result: Enter a string: Hello[]World Result[He, ll, o[] , Wo, rl, d_]

    Codewars testing window: Should handle Space in string expected:<[He, ll, o[] , Wo, rl, d_]> but was:<[He, ll, o[,] , Wo, rl, d_]>

  • Exajs Avatar

    This comment has been hidden.

  • rhsalas3 Avatar

    This comment has been hidden.

  • SmartDog3 Avatar

    Failed asserting that two arrays are equal.

    Expected: Array ( )

    Actual : Array ( 0 => ' ' )

    Does anyone know what this means?

    I tested my code in Visual Studio Code no problem, but when I tested it on the site this message appears.

    Note: I used PHP 7.0

  • nicholas_wijaya Avatar

    This comment has been hidden.

  • qutick_ Avatar

    This comment has been hidden.

  • kuralex Avatar

    This comment has been hidden.

  • --Filip Avatar

    I have this error: IndexError: pop from empty list

    I don't know what I did wrong because when I check this code in visual studio code there is no error

  • Yurii.s Avatar

    This comment has been hidden.

  • redluis Avatar

    can someone explain to me what this error means:

    Response received but no data was written to STDOUT or STDERR.

  • Auryora Avatar

    This comment has been hidden.

  • mainul__islam Avatar

    This comment has been hidden.

  • iamlimohd Avatar

    This comment has been hidden.

  • dummyaccount Avatar

    Should be 5kyu tbh

  • lazyfox80 Avatar

    This comment has been hidden.

  • Rostik5530 Avatar

    probably found an error when testing in C#. it is necessary instead of " Assert.AreEqual" use " CollectionAssert.AreEqual", so that it compares not the collection references, but the values themselves.

  • TilteD24 Avatar

    I have tried the code on my IDE (C++) and am getting correct output but while running the tests it keeps giving error: linker command failed with exit code 1 (use -v to see invocation).

  • kenmaclord Avatar

    I have these errors :

    expected [ Array(15) ] to deeply equal [ Array(22) ] expected [ 'ts', 'ai', 'az', 'fu', 'yg', 'q' ] to deeply equal [ Array(10) ] expected [ 'bz', 'h', 'v', 'z' ] to deeply equal [ 'bz', 'Oh', 'EQ', 'Mv', 'Yz' ]

    and I really don't understand what's happening because it's not what it is asked. Any clue someone ?

  • magnustymoteus Avatar

    I passed the test, but when i click attempt it gives the following error message:

    UndefinedBehaviorSanitizer:DEADLYSIGNAL ==1==ERROR: UndefinedBehaviorSanitizer: stack-overflow on address 0x7ffd609bb000 (pc 0x000000425a69 bp 0x7ffd609ba310 sp 0x7ffd609ba300 T1) ==1==WARNING: invalid path to external symbolizer! ==1==WARNING: Failed to use and restart external symbolizer! #0 0x425a68 (/workspace/test+0x425a68) #1 0x4257ba (/workspace/test+0x4257ba) #2 0x4285eb (/workspace/test+0x4285eb) #3 0x426ebe (/workspace/test+0x426ebe) #4 0x4267fd (/workspace/test+0x4267fd) #5 0x4264eb (/workspace/test+0x4264eb) #6 0x42c035 (/workspace/test+0x42c035) #7 0x425cdd (/workspace/test+0x425cdd) #8 0x7f3be1df4bf6 (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6) #9 0x404879 (/workspace/test+0x404879)

    ==1==ABORTING

  • jwpjrdev Avatar

    This was a good challenge. I spent a little bit learning some regex for it.

  • phlowerchild Avatar

    This comment has been hidden.

  • adudek717 Avatar

    This comment has been hidden.

  • 101-b Avatar

    This comment has been hidden.

  • rajup Avatar

    This comment has been hidden.

  • CMEXOTPOH Avatar

    Pull some strings if you have to.

  • Duvud Avatar

    I have some kind of strange bug in the testing process, i have the rigth answer but the test just keep failing. expected [ 'a', 'bc', 'de' ] to deeply equal [ 'ab', 'cd', 'ef' ].

  • ivandez Avatar

    This comment has been hidden.

  • professorx-x Avatar

    This comment has been hidden.

  • JamesSneyd Avatar

    This comment has been hidden.

  • cheesebu Avatar

    This comment has been hidden.

  • suic Avatar

    Groovy translation kumited. Please review and approve. Thanks, suic

  • imjasonmiller Avatar
  • B1ts Avatar

    This comment has been hidden.

  • calx Avatar

    I got the right answer, but it still failed me :(

    odd_length Expected: [ ab, cd, e_ ] Actual: [ ab, cd, e_ ]

  • Kayrim Avatar

    This comment has been hidden.

  • shadow_8 Avatar

    how can i do it in c++, how to return list in c++?

  • Jejd Avatar

    This comment has been hidden.

  • Jejd Avatar

    This comment has been hidden.

  • Scarlet_31 Avatar

    This comment has been hidden.

  • mikifriki Avatar

    Could'nt seem to get it working with php in anyway I tried.

    Tried using my own solution and after givin up, unlocking solutions and trying the other solutions I still couldnt get it working.

    Kept getting the error Failed asserting that two arrays are equal. when running tests.

  • nesteiner Avatar

    This comment has been hidden.

  • pp641 Avatar

    This comment has been hidden.

  • nejc.schneider Avatar

    Works fine on my computer. But in browser always throws this error: "TypeError: solution is not a function".

  • Ibrahimthaqi Avatar

    Hi i need some help please, am splitting array but how can i add underscore at the and i tried with Array.fill and some other methods but wont work

  • bokchoi8 Avatar

    i am struggling with how the testin is done does anything need to be changed ??

  • Mawazo2 Avatar

    Hi, i'm struggling with powershell. Passing all tests apart from 3 or 4 with same error.

    Expected: value to be empty but it was { }

    Please could someone point me in the right direction as to what i'm missing?

    Thanks

  • iiulian9 Avatar

    Output the same as the one requested, returned a vector of type string called result. Odd length tests don't pass, used INSERT() to add the _ character. Might that be the issue?

  • treygriffith Avatar

    The test cases should add Unicode since that's an important consideration when dealing with strings, e.g. having the letter "ë" in the tests would break several implementations. See more here: https://mortoray.com/2013/11/27/the-string-type-is-broken/

  • Sabes Avatar

    This comment has been hidden.

  • Ricardo_S Avatar

    I need help in this kata. My code isn´t return a array but i dont know where is the error. Please anybody may i help.

    congratulations.

  • gillianlyle Avatar

    This comment has been hidden.

  • Ibrahimthaqi Avatar

    Guys any help, am using if to test string length if its even than s.split ("(?<=\G..)"), and else spliting same way and creating new array input = Arrays.copyOf(input, input.length + 1); //create new array from old array and allocate one more element input[input.length -1] = ""; but am getting this one as a result as,da,a,, but i should return as,da,a_ any help please how to do that?

  • DeathWraith Avatar

    What are we supposed to in case of a ""? I feel like that is what my mistake is, as I can't seem to understand what I did wrong...

    Later that day...messing around with the code... solution "" = [] lol oops

  • clcraig Avatar

    C++ translation. Please review.

  • clcraig Avatar

    Java translation. The original translation was by MartinPescatore. I added randomized tests, updated the description for Java/C/C++, and cleaned up the code some. Please review.

  • SlowKingV Avatar

    All the Random Tests in Ruby expect nothing (Expected: []), but the random test do generate strings.

  • UlrichBerntien Avatar

    The String type in Julia can contain unicode characters. The unicde characters could be stored in more than one byte. So not all str[i] will be correct character because it could be a part of a unicode character.

    I suggest to add the test case:

      pairs = solution("ΔbΨd")
      @fact length(pairs) --> 2 "non-ascci chars: solution should return an array with correct number of pairs"
      @fact pairs[1] --> "Δb" "non-ascci chars: first pair in solution(\"ΔbΨd\") should be \"Δb\""
      @fact pairs[2] --> "Ψd" "non-ascci chars: last pair in solution(\"ΔbΨd\") should be \"Ψd\""
    

    This test case will fail if strings are splitted into bytes and not into characters.

  • user8436785 Avatar

    Crystal solution is in global scope.

  • user8436785 Avatar

    Actual and expected swapped in PHP.

  • solo-leveling Avatar
    describe("Solution", function() {
      it("should test for something", function() {
        // Test.assertEquals(1 + 1, 2);
        // assert.strictEqual(1 + 1, 2);
      });
    });
    

    Is it String split or both?

  • Zipfer Avatar

    Description is not clear

  • beekman Avatar

    JavaScript version has no tests. Frustrating to discover that it can't be completed.

  • Waffle3z Avatar

    This comment has been hidden.

  • Unnamed Avatar

    Clojure: there's effectively only 1 fixed test and 1 random test; deftest creates a global definition no matter where it occurs.

  • hehichens Avatar

    This comment has been hidden.

  • ren70n Avatar

    there is no way to run the tests for golang version looks like there are no tests

    # codewarrior/kata_test [codewarrior/kata.test]
    ./kata_test.go:8:3: imported and not used: "github.com/onsi/gomega"
    ./kata_test.go:9:3: imported and not used: "codewarrior/kata"
    
  • faustAbc Avatar

    This comment has been hidden.

  • boxlady Avatar

    Php- keep getting this error. Parse error: syntax error, unexpected end of file in /home/codewarrior/run.php on line 23

  • boroda_29 Avatar

    This comment has been hidden.

  • stellartux Avatar
  • xavierguihot Avatar

    Scala translation available for review.

  • NecroticKnight Avatar

    "solution did not return pairs with correct values" what can it mean, I passed all random tests except one, but in my test with even number of letters in string evrything work fine

  • ciexieboojai Avatar

    hi, i solved this kata (kata told me to unlock), still, when i try to submit, it shows up under my own profile and solutions, but i'm told i have not resolved the kata and hence cannot view the solutions. trying to refactor the code won't work (bug in codewars), code 422. i may be still very new with python, but i'm confident my code works. (the tests were positive, too.) is there an issue with this specific kata, or did i miss any specifics so it doesn't get accepted in the end. (i removed the "pass" from my solution.") => ? any help appreciated!

  • werran Avatar

    no sample test for js. You can just print return; and it works...

  • getterhiss Avatar

    No tests included for JavaScript version. Can not complete exercise.

  • Dewars Avatar

    Test for JS: describe("solution", function(){ it("should test for something", function(){ Test.expect(solution("abc"), ['ab', 'c_']); Test.expect(solution("abcdef"), ['ab', 'cd', 'ef']); }); });

  • bobbysebolao Avatar

    This comment has been hidden.

  • mboushab Avatar

    Hi guys,

    It returns this after running "This is just an example of how you can write your own TDD tests - Expected: 'expected', instead got: 'actual'"

    What does this mean?

  • cserrano3 Avatar

    It's necessary to create test cases for this kata. It's not passing the last attempt for some reason.

  • dcronin05 Avatar

    This comment has been hidden.

  • KennethYCK Avatar

    Powershell version, once i wanta type "@" , all code will be gone

  • mfournier91 Avatar

    This comment has been hidden.

  • Geshode Avatar

    JS version doesn't have any tests, so it can not be completed at the moment.

  • alex-sobolev Avatar

    JS tests should contain a comparison of what was expected and what was received when a test fails. Please also add sample tests for JS

  • Console Cowboy Avatar
  • belalsh322 Avatar

    No samples for JS

  • msiadak Avatar

    There are no sample tests for Go.

  • Voile Avatar

    CoffeeScript, Go, JS and Ruby versions need to be completely rewritten and with random tests added.

  • Adriana Guerrero Avatar

    I've an error running tests for JS.

  • Unihedron Avatar

    This comment has been hidden.

  • user6793616 Avatar

    For JS: Write your own test in the panel below your script. It is a nice exercise. Hint: write a test for what the empty string should return.

  • armstrongamberly Avatar

    Ruby version doesn't seem to actually be testing for anything.

  • inessino Avatar

    This comment has been hidden.

  • Mcoury Avatar

    Bad tests, horribly written. Should be revised or removed..

  • Eyewritecode Avatar

    SMH, this Kata got me feeling some typa way

  • mericbal Avatar

    Bad test in Ruby , no information on failing whatever ..

  • tspeed90 Avatar

    I enjoyed the Kata, though I passed it fairly easily so I'm wondering if it was accurately labeled as a 6. Seems like maybe a 7kyu? Anyhow, I wish there were example tests for javascript, but I understand that I should learn how to write in my own. I think that is something I will work on figuring out next!

  • Ciwan Avatar

    I can't see any tests for this in JavaScript. Though when I submit, it says 5 Tests Passed, and one failed, but the reason for the failure is super strange, it makes no sense.