leetcode卡 leetcode weekly contest 186:第186届LeetCode周赛

pkunkfeifei 0 0 zip 2024-10-07 01:10:01

leetcode卡 leetcode-weekly-contest-186 第186届LeetCode周赛问题清单:

拆分字符串后的最大分数

题目

Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and right substring).

题目解释

拆分字符串后的分数是左子字符串中零的数量加上右子字符串中一的数量。

示例 1

  • 输入:s = \"011101\"

  • 输出:5

  • 解释

所有可能的拆分方式:

  • 左 = \"0\" 和右 = ...

用户评论
请输入评论内容
评分:
暂无评论