harshvasoya008's blog

By harshvasoya008, 6 years ago, In English

First of all, let me feed you all the details:

In the above-mentioned solution, there is a block of logic as mentioned below:

if(!flag['a' - *(s.end() - 1)] && *(s.end() - 1) != 'n')
{
    cout<<"NO"<<endl;
    return 0;
} 

Here, we can see that first condition in the if statement is wrong. So I targeted that statement for my hack with the input "ae". Here we can see that the program will try to access flag['a'-'e'] which doesn't exist and hence should return false and should go inside the if block and print NO.

But as per the verdict of the hack, output was YES which is quite contradictory. Also, the same solution yielded the desirable output (i.e NO) on main test 23 with the similar kind of input.

Thus, I am requesting testers demon1999 and winger to kindly look into this matter.

Thank you.

Full text and comments »

  • Vote: I like it
  • +5
  • Vote: I do not like it