LeetCode --- 1576. Replace All ?‘s to Avoid Consecutive Repeating Characters 解题报告
Posted 杨鑫newlfe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 1576. Replace All ?‘s to Avoid Consecutive Repeating Characters 解题报告相关的知识,希望对你有一定的参考价值。
Given a string s
containing only lowercase English letters and the \'?\'
character, convert all the \'?\'
characters into lowercase letters such that the final string does not contain any consecutive repeating characters. You cannot modify the non \'?\'
characters.
It is guaranteed that there are no consecutive repeating characters in the given string except for \'?\'
.
Return the final string after all the conversions (possibly zero) have been made. If there is more than one solution, return any of them. It can be shown that an answer is always possible with the given constraints.
Example 1:
Input: s = "?zs" Output: "azs" Explanation: There are 25 solutions
以上是关于LeetCode --- 1576. Replace All ?‘s to Avoid Consecutive Repeating Characters 解题报告的主要内容,如果未能解决你的问题,请参考以下文章
LeetCode力扣打卡之1576. 替换所有的问号(Python3)
LeetCode --- 1576. Replace All ?‘s to Avoid Consecutive Repeating Characters 解题报告
LeetCode --- 1576. Replace All ?‘s to Avoid Consecutive Repeating Characters 解题报告