Codeforces 861 C. Did you mean... (模拟)

Beroffice文本编辑器具有自动查找拼写错误并提供修复建议的功能。如果单词中有连续3个或更多不同的辅音字母(特殊情况:相同字母连续不算),则认为存在拼写错误。任务是插入最少数量的空格来分隔单词,确保每个子单词没有拼写错误。输入一个非空单词,输出可能的修正结果,保持插入空格的最小数量。解决方案涉及在可能的错误位置末尾添加空格并验证新单词是否符合无错误条件。
摘要由CSDN通过智能技术生成

Description

Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.

Beroffice works only with small English letters (i.e. with 26 letters from a to z). Beroffice thinks that a word is typed with a typo if there are three or more consonants in a row in the word. The only exception is that if the block of consonants has all letters the same, then this block (even if its length is greater than three) is not considered a typo. Formally, a word is typed with a typo if there is a block of not less that three consonants in a row, and there are at least two different letters in this block.

For example:

the following words have typos: “hellno”, “hackcerrs” and “backtothefutttture”;

the following words don’t have typos: “helllllooooo”, “tobeornottobe” and “oooooo”.

When Beroffice

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值