Ad
  • Custom User Avatar

    Hi,

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

  • Custom User 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
    
  • Custom User 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