Mars Exploration

  • + 0 comments

    int marsExploration(char* s) { char* a = malloc(strlen(s)*sizeof(char)); strcpy(a,s); int count=0; for(int i=0;a[i]!='\0';i++){ if(a[i]!='S' && a[i]!='O') count++; } return count; } Why it is showing only some test cases are fail?