In c++ i need to make a function that removes the modifies the original string to remove the third occurence of a character to only have max of 2 occurences for example "aabacdbbddccccc" would be...


In c++ i need to make a function that removes the modifies the original string to remove the third occurence of a character to only have max of 2 occurences for example


"aabacdbbddccccc" would be modified to


"aabcdbdc"


in the image below is what i have so far


1<br>#include <iostream><br>#include <cstring><br>void condense(char s[]);<br>int main()<br>{<br>3<br>4<br>char s[] = {

Extracted text: 1 #include #include void condense(char s[]); int main() { 3 4 char s[] = {"abcadmmdefagdbfffbdr condense(s); 7 std::cout « s; return 0; } _1 // INPUT = abcadmmdefagdbfffbdm abcadmmdefgbf _2 // OUPUT = _3 void condense(char s[]) _4 { _5 _6 -7 _8 int counter; char *i, *j; i = s; j = s; while (*i ± '\0') { it; while (*j + '\0') { 22 23 24 j#; } } 25 26 27 28 return; 29 } // std::cout « *i; 31 // i#

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here