Skip to content

an algorithm that could replace the same 3 letters to previous one or delete

Notifications You must be signed in to change notification settings

Congying719/stringRemoveReplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

stringRemoveReplace

an algorithm that could replace the same 3 letters to previous one or delete

For a given string that only contains alphabet characters a-z, if 3 or more consecutive characters are identical, remove them from the string. Repeat this process until there is no more than 3 identical characters sitting besides each other.

please refer to the method removeConsecutiveStr

Instead of removing the consecutively identical characters, replace them with a single character that comes before it alphabetically.

please refer to the method replaceConsecutiveChars

use Junit to auto test the functions

About

an algorithm that could replace the same 3 letters to previous one or delete

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages