I used a simplified solution to this problem which focuses of printing the solution (as required ) instead of extracting the words. i have run multple tests which seem to be working fine with my code, but i am unable to pass any of the testcases .
i have accounted for the terminating null chars and newlines in my implementation but nothing seems to be working :
Please go through my code for your reference:
#include
#include
#include<ctype.h>
using namespace std;
int main() {
string s;
cin>>s;
for (int i=0;i<s.length()+1;i++){
if(islower(s[i])==1){
cout<<s[i];
}
else if(i==0){
cout<<s[i];
}
else{
cout<<β\0β<<endl<<s[i];
}
}
cout<<β\0β;
return 0;
}
//Thanks for your guidance 
