Beta

Rotate Right

Description
Loading description...
  • Please sign in or sign up to leave a comment.
  • Blind4Basics Avatar

    Hi,

    Unfortunately, that's a duplicate (and there are probably more out there).

  • rowcased Avatar

    The function name should be changed because otherwise it's completely misleading / confusing / inaccurate, as there is no mention of shuffling in the description and no actual shuffling required or expected within the algorithm.

    To nonetheless prevent invalidation of the solutions submitted so far, you may implement this code in your test suite:

    try:
        from solution import shuffle_right as rotate_right
    except ImportError:
        from solution import rotate_right
    
    • rowcased Avatar

      ...optionally, because it's still in beta, you could stil simply consider a more apt kata title (such as) Bookending Arrays with a function name of bookend_array.

  • PetitLu117 Avatar

    In the example and submit tests,

    • the second it title contains two times the word return.
    • The fourth it title says false instead of None.
  • TheLittlePixiesFriend Avatar

    The description says to first rotate the array, then check if it's bookended.

    The tests however require the array to be returned as is if it's already bookended without rotation

  • dfhwze Avatar

    move each element to the right -> in which order ? Tbh, I don't understand anything at all of this spec. If this is the current standard of a good description, I'm tuning out.

    • AlamarW Avatar

      I made some adjustments based on your feedback. I hope with the adjustments I made to the feedback that it's more clear what I want people to try and do. I also changed the title to this Kata to reflect this clarity.

    • dfhwze Avatar

      Yes, much better. Although, only the examples show to pick elements from the right. I've been going through the array from left to right all the time, moving elements to the right.

  • Fbasham Avatar
    • needs random tests
    • I'm not sure I agree with a return of False if the array can't be shuffled. None would be more suitable.