+ 3
Why always shows same output
Coach challenges https://code.sololearn.com/cdExYZHQE5zF/?ref=app
6 Answers
+ 5
Few changes, I copypaste only that parts.
//initialize flag to 0
int flag=0;
...
for(int i=0;i<l;i++)//comparing
{
// look only after each i, then you don't need the continue part
for(int j=i+1;j<l;j++)
{
if (str[i]==str[j])
{
// only if repetition set to true
flag=1;
}
}
}
if (flag) // flag should be true if duplicate
printf("Deja Vu");
else
printf("Unique");
+ 4
Yes, sorry, I forgot to mention that I changed that - i or j <l!
+ 1
~ swim ~ thanks
I don't see that <=1
+ 1
HonFu thank yoy
0
HonFu can you plz check this
0
HonFu đthat flag value