Skip to content

Prodigy00/AlternatingCharacters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Non Repeating Alternating Characters

Manipulates a string such that there are no matching adjacent characters. Done with Linked List.

This is my attempt at solving the question:

You are given containing characters A and B only. Your task is to change it into a string such that there are no matching adjacent characters. To do this, you are allowed to delete zero or more characters in the string. Your task is to find the minimum number of required deletions.

Sample Input

ASSSSDADDD
AAAA
BBBBB
ABABABAB
BABABA
AAABBB

Sample Output

5
3
4
0
0
4

I have set up the code to run with prompt-sync, an npm package that collects user input so as to make testing this easier. Your observations are welcome!

About

Manipulates a string such that there are no matching adjacent characters. Done with Linked List.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published