使用C++移除两个零之间的元素
在本文中,我们将讨论如何从一个只包含0和1字符的给定字符串中删除两个零之间的元素。最终的字符串不应包含任何被0包围的字符'1'。例如-
Input : string = “110010” Output : “11000” Explanation: 1 is found between two zeros at the 4th index. Input : string = “0010” Output : “000” Explanation : 1 is found between two zeros at the 2nd index.登录后复制