Removing consecutive duplicates using Stack| JAVA

Published --