remove consecutive duplicate characters in a string c++

cmu cs double major requirements
You can only compare 4 properties, any new property added will replace the first one from the comparison.