{"kind":"task","effective_mode":"full","benchmark":{"kind":"benchmark","effective_mode":"full","slug":"livecodebench","formal_name":"LiveCodeBench","introduction":"競技プログラミングの新しい問題を継続的に収集し、コードに関する能力を評価するベンチマークです。初期release_v1は400問で、問題の出題元と公開日時、データセットの版を区別して扱います。\n\nLiveCodeBench 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"},"task_id":"20055049-47a5-592c-9007-b8bc99d8d376","task_key":"release~5fv1--test--2892","task_revision_id":"1","upstream_id":"2892","short_description":"check-if-array-is-good","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-07-22T00:00:00\",\"contest_id\":\"biweekly-contest-109\",\"difficulty\":\"easy\",\"platform\":\"leetcode\",\"question_content\":\"You are given an integer array nums. We consider an array good if it is a permutation of an array base[n].\\nbase[n] = [1, 2, ..., n - 1, n, n] (in other words, it is an array of length n + 1 which contains 1 to n - 1 exactly once, plus two occurrences of n). For example, base[1] = [1, 1] and base[3] = [1, 2, 3, 3].\\nReturn true if the given array is good, otherwise return false.\\nNote: A permutation of integers represents an arrangement of these numbers.\\n \\nExample 1:\\n\\nInput: nums = [2, 1, 3]\\nOutput: false\\nExplanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. However, base[3] has four elements but array nums has three. Therefore, it can not be a permutation of base[3] = [1, 2, 3, 3]. So the answer is false.\\n\\nExample 2:\\n\\nInput: nums = [1, 3, 3, 2]\\nOutput: true\\nExplanation: Since the maximum element of the array is 3, the only candidate n for which this array could be a permutation of base[n], is n = 3. It can be seen that nums is a permutation of base[3] = [1, 2, 3, 3] (by swapping the second and fourth elements in nums, we reach base[3]). Therefore, the answer is true.\\nExample 3:\\n\\nInput: nums = [1, 1]\\nOutput: true\\nExplanation: Since the maximum element of the array is 1, the only candidate n for which this array could be a permutation of base[n], is n = 1. It can be seen that nums is a permutation of base[1] = [1, 1]. Therefore, the answer is true.\\nExample 4:\\n\\nInput: nums = [3, 4, 4, 1, 2, 1]\\nOutput: false\\nExplanation: Since the maximum element of the array is 4, the only candidate n for which this array could be a permutation of base[n], is n = 4. However, base[4] has five elements but array nums has six. Therefore, it can not be a permutation of base[4] = [1, 2, 3, 4, 4]. So the answer is false.\\n\\n \\nConstraints:\\n\\n1 <= nums.length <= 100\\n1 <= num[i] <= 200\",\"question_title\":\"check-if-array-is-good\",\"starter_code\":\"class Solution:\\n    def isGood(self, nums: List[int]) -> bool:\\n        \"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://livecodebench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}