Beta

Rotated string

188 of 363pinelopi
Description
Loading description...
Algorithms
Strings
  • Please sign in or sign up to leave a comment.
  • feedmycats Avatar

    Everything worked fine on Python. It's an interesting kata, well done.

  • hobovsky Avatar
  • saudiGuy Avatar

    possible duplicate ?

  • saudiGuy Avatar

    Tests should use python test framework: https://docs.codewars.com/languages/python/codewars-test

    • missing import
    • missing test.it blocks
    • missing test.describe
  • balu9 Avatar

    The description is abstract, just random examples won't do the job, for instance an empty string returns true, why didn't you put it in the description?

  • JoshuaCF Avatar

    The description of the challenge is not very complete, only giving examples of what consitutes a rotated string and not the definition of a rotated string. I had to read it a couple of times to figure out what they were. Saying whether a string was right or left rotated confused me slightly as that led me to expect the program to also differentiate what strings were right and left rotated. You can keep that there, but make it clear that it isn't required in the program, only for the knowledge of a rotated string.

  • Tototo Avatar

    Whats being passed as the parameters for the second test???

  • donaldsebleung Avatar

    Needs random test cases

  • Utkarsh Agarwal Avatar

    Remove the extra brace at the end of the test case.

  • user1385724 Avatar

    Test class doesn't not compile (because has extra brace). Is it correct?

  • matt c Avatar

    Needs random test cases :)

  • ToshiCG Avatar

    I don't know if "string rotation" is a common concept but I haven't heard of it. Due to lack of explanation the solution involves more guesswork then it should in my opnion.

  • idubrov Avatar

    Example test case does not compile

  • vladkha Avatar

    Needns nore explaining information about "edge" cases. Extra brace in tests.

  • user3028132 Avatar

    There is an extra braces in the java test cases

  • WWW21 Avatar

    Also, translated into Java.

  • WWW21 Avatar
    • Details/instructions on the definition of a "rotated string" is not clear. Specifically, the examples do not indicate that the rotation point could be anywhere within the string or even nowhere in the string.
    • Edge cases should also be explicitly defined, especially since they are part of the test cases (e.g., null strings return what).
    • Related to above: how should uppercase and lower case characters be handled? white space?
    • The details/instructions say True if one string is a rotation of another. This means s2 could be a rotation of s1, and ALSO s1 could be a rotation of s2! Either more test cases should be added, or the instructions should be changed so that the order of the function's arguments are explicitly defined.
    • Descriptions and error messages for test cases would be nice.
  • Vogel612 Avatar

    Please describe what exactly is meant by "rotation" it's not clear from the context and word alone.

    Also test-cases don't give nice information about what went wrong.

  • ZozoFouchtra Avatar

    JS translation kumited.