Please help me with this doubt.
Please help me with this doubt
@cbcao263 hey you can simply take the difference between characters and print them, start from 1 and go till length of string.
@cbcao263 here is how you can do all things, this will be done in O(n)
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
transform(s.begin(), s.end(), s.begin(), ::tolower); //convert string to lower case.
set<char> vowel={'a','e','i','o','u'};
string ans="";
//Vowels are a,e,i,o,u
for(int i = 0;i<s.size();i++)
{
if(vowel.find(s[i])==vowel.end())
{
if(s[i]>'a' && s[i]<='z') //checking if alphabet
ans.push_back('.');
ans.push_back(s[i]);
}
}
cout<<ans; //desired string
}
//Delete all Vowels, How can I delete it
//Inserts a character "." before each constraint
//Replaces alll uppercase with lowercase ones.
If this resolves your doubt mark it as resolved.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.