Remove Consecutive Duplicates

My code is working fine if the duplicates are in the beginning of the string, for duplicates in between, it skips them and gives output obtained till that point. Please help

Edited code to : https://ide.codingblocks.com/s/216983

Works fine for test cases now but not giving any result on HackerBlocks. Please check


this works fine and it got submitted on hackerblocks as well