“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
You are given two strings: S1 and S2. Delete from S2 all those characters which occur in S1 also and create a clean S2 with the relevant characters deleted.
#include<stdio.h>
#include<string.h>
main() {
char str1[5] = “abcd”;
char str2[3] = “bc”;
int len = strlen(str1);
int i =0;
char newstr[len];
int cntr = 0;
for ( i = 0; i<len; i++ ) {
if ( strchr(str2,str1[i]) == NULL ) {
newstr[cntr++] = str1[i];
}
}
newstr[cntr] = ‘