Hi Farnak,
Error is at line#33 in the code. See here:
>>if (line1[i-1] == line2[j-1])
Index for both the strings starts at 0 and ends at len-1, and so it should be [i-1] and [j-1]. U hvn't checked the first characters of both the strings.
Search found 2 matches
- Mon Apr 28, 2008 12:38 am
- Forum: Volume 101 (10100-10199)
- Topic: 10192 - Vacation
- Replies: 58
- Views: 24092
- Sun Apr 27, 2008 9:25 pm
- Forum: Volume 5 (500-599)
- Topic: 531 - Compromise
- Replies: 73
- Views: 37115
Re: 531 - Compromise - WA
Hi -zx-,
There is a logical error at line #18 in the code. Its here :
>> else if ( emo[i-1][j].size() < emo [j-1].size() )
The code counts the total number of characters in emo[i-1][j] and emo [j-1], where it should actually be counting the number of words(and not no. of characters) in these 2 ...
There is a logical error at line #18 in the code. Its here :
>> else if ( emo[i-1][j].size() < emo [j-1].size() )
The code counts the total number of characters in emo[i-1][j] and emo [j-1], where it should actually be counting the number of words(and not no. of characters) in these 2 ...