+ 4
Compare two input strings
please help me! 🙏 how can I campare two input strings and print the number of differences? .... for example : Input: Nbbjhfdg Nbbghydg output : 2
6 Réponses
+ 1
To test for a loose correlation you will need to use 'Fuzzy matching' there are many methods and the algorithms can be quite complex to implement. I suggest you start researching 'Levenshtein distance'
+ 1
@sushmita
how actually I code that
that's the point
- 1
use this statements with including string header
string s1, s2;
if(s1==s2)
or
bool x=s1.compare(s2); // returns true or false
if(s1>s2)
if(s1<s2)
- 1
well u can get the difference of sums of ASCII values for ur string ,
- 1
Hello roshan,
I ve written the code as mentioned,
check in my codes for "string subtraction", it ll help you