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.
ASSSSDADDD
AAAA
BBBBB
ABABABAB
BABABA
AAABBB
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!