{"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":"283c98c1-814b-5e9f-844a-ffa6c3222465","task_key":"release~5fv1--test--2786","task_revision_id":"1","upstream_id":"2786","short_description":"find-the-longest-semi-repetitive-substring","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-06-10T00:00:00\",\"contest_id\":\"biweekly-contest-106\",\"difficulty\":\"medium\",\"platform\":\"leetcode\",\"question_content\":\"You are given a 0-indexed string s that consists of digits from 0 to 9.\\nA string t is called a semi-repetitive if there is at most one consecutive pair of the same digits inside t. For example, 0010, 002020, 0123, 2002, and 54944 are semi-repetitive while 00101022, and 1101234883 are not.\\nReturn the length of the longest semi-repetitive substring inside s.\\nA substring is a contiguous non-empty sequence of characters within a string.\\n \\nExample 1:\\n\\nInput: s = \\\"52233\\\"\\nOutput: 4\\nExplanation: The longest semi-repetitive substring is \\\"5223\\\", which starts at i = 0 and ends at j = 3. \\n\\nExample 2:\\n\\nInput: s = \\\"5494\\\"\\nOutput: 4\\nExplanation: s is a semi-reptitive string, so the answer is 4.\\n\\nExample 3:\\n\\nInput: s = \\\"1111111\\\"\\nOutput: 2\\nExplanation: The longest semi-repetitive substring is \\\"11\\\", which starts at i = 0 and ends at j = 1.\\n\\n \\nConstraints:\\n\\n1 <= s.length <= 50\\n'0' <= s[i] <= '9'\",\"question_title\":\"find-the-longest-semi-repetitive-substring\",\"starter_code\":\"class Solution:\\n    def longestSemiRepetitiveSubstring(self, s: str) -> int:\\n        \"}","display_format":"text","language":"","answer_status":"published","assets":[],"source_url":"https://livecodebench.github.io/","history":"initial import","indexing_mode":"noindex","subproblems":[],"grids":[]}