{"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":"75134f26-3ac2-5d8e-8931-16ad52b96f2b","task_key":"release~5fv1--test--2884","task_revision_id":"1","upstream_id":"2884","short_description":"length-of-the-longest-valid-substring","config":"release_v1","split":"test","body":"{\"contest_date\":\"2023-07-16T00:00:00\",\"contest_id\":\"weekly-contest-354\",\"difficulty\":\"hard\",\"platform\":\"leetcode\",\"question_content\":\"You are given a string word and an array of strings forbidden.\\nA string is called valid if none of its substrings are present in forbidden.\\nReturn the length of the longest valid substring of the string word.\\nA substring is a contiguous sequence of characters in a string, possibly empty.\\n \\nExample 1:\\n\\nInput: word = \\\"cbaaaabc\\\", forbidden = [\\\"aaa\\\",\\\"cb\\\"]\\nOutput: 4\\nExplanation: There are 11 valid substrings in word: \\\"c\\\", \\\"b\\\", \\\"a\\\", \\\"ba\\\", \\\"aa\\\", \\\"bc\\\", \\\"baa\\\", \\\"aab\\\", \\\"ab\\\", \\\"abc\\\" and \\\"aabc\\\". The length of the longest valid substring is 4. \\nIt can be shown that all other substrings contain either \\\"aaa\\\" or \\\"cb\\\" as a substring. \\nExample 2:\\n\\nInput: word = \\\"leetcode\\\", forbidden = [\\\"de\\\",\\\"le\\\",\\\"e\\\"]\\nOutput: 4\\nExplanation: There are 11 valid substrings in word: \\\"l\\\", \\\"t\\\", \\\"c\\\", \\\"o\\\", \\\"d\\\", \\\"tc\\\", \\\"co\\\", \\\"od\\\", \\\"tco\\\", \\\"cod\\\", and \\\"tcod\\\". The length of the longest valid substring is 4.\\nIt can be shown that all other substrings contain either \\\"de\\\", \\\"le\\\", or \\\"e\\\" as a substring. \\n\\n \\nConstraints:\\n\\n1 <= word.length <= 10^5\\nword consists only of lowercase English letters.\\n1 <= forbidden.length <= 10^5\\n1 <= forbidden[i].length <= 10\\nforbidden[i] consists only of lowercase English letters.\",\"question_title\":\"length-of-the-longest-valid-substring\",\"starter_code\":\"class Solution:\\n    def longestValidSubstring(self, word: str, forbidden: List[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":[]}