Skip to content

Latest commit

 

History

History
 
 

2957.Remove-Adjacent-Almost-Equal-Characters

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

2957.Remove-Adjacent-Almost-Equal-Characters

如果有三个连续的字母不满足条件(即相邻元素不是almost equal),那么我们只需要改动中间的一个字母,必然能够使其满足条件。由此可以拓展,如果有连续n个字母不满足条件,那么我们只需要每间隔一个地改动字母即可,改动的数目即是n/2.