{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"livecodebench","formal_name":"LiveCodeBench","introduction":"LiveCodeBench continuously collects new competitive-programming problems to evaluate coding capabilities. Its initial release_v1 contains 400 problems, with source platform, contest date, and dataset version tracked explicitly.","introduction_ja":"","introduction_en":"","category":"Category not supplied","task_count":null,"acquisition_status":"Acquisition status not supplied","official_url":"https://livecodebench.github.io/","indexing_mode":"noindex","profile":{"resources":[],"task_format":"","scoring":"","metric":"","size":"","answer_access":"","license":"","citation":"","maintainer":"","released":"","why_hard":"","related":[]}},"task_id":"a959bec2-6ddf-548e-b547-bf47092a7e0c","task_key":"release~5fv1--test--3045","task_revision_id":"2","upstream_id":"3045","short_description":"minimum-right-shifts-to-sort-the-array","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-09-16T00:00:00\",\"contest_id\":\"biweekly-contest-113\",\"difficulty\":\"easy\",\"platform\":\"leetcode\",\"question_content\":\"You are given a 0-indexed array nums of length n containing distinct positive integers. Return the minimum number of right shifts required to sort nums and -1 if this is not possible.\\nA right shift is defined as shifting the element at index i to index (i + 1) % n, for all indices.\\n \\nExample 1:\\n\\nInput: nums = [3,4,5,1,2]\\nOutput: 2\\nExplanation: \\nAfter the first right shift, nums = [2,3,4,5,1].\\nAfter the second right shift, nums = [1,2,3,4,5].\\nNow nums is sorted; therefore the answer is 2.\\n\\nExample 2:\\n\\nInput: nums = [1,3,5]\\nOutput: 0\\nExplanation: nums is already sorted therefore, the answer is 0.\\nExample 3:\\n\\nInput: nums = [2,1,4]\\nOutput: -1\\nExplanation: It's impossible to sort the array using right shifts.\\n\\n \\nConstraints:\\n\\n1 <= nums.length <= 100\\n1 <= nums[i] <= 100\\nnums contains distinct integers.\",\"question_title\":\"minimum-right-shifts-to-sort-the-array\",\"starter_code\":\"class Solution:\\n    def minimumRightShifts(self, nums: List[int]) -> int:\\n        \"}","display_format":"text","language":"","answer_status":"external_grader","assets":[],"source_url":"https://livecodebench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}