Program to generate random test cases for PRPALN

Can anyone please explain me what logic should be used to code a random test case generator for problem PRPALN
Let us construct palindrome of November Challenge.

I wan to know how can we code in such a way that the string should have a palindromic sequence…??

For my opinion, I will make a random test case for that problem by one or all of below:

  1. Make a palindrome sequence, then result will be “yes” because if you delete the element at position n/2, it is still a palindrome sequence.

  2. Make a palindrome sequence, then at any position in the sequence, you add one element at any position, then the result will be “yes”, of course.

  3. Make a palindrome sequence, then you add one element at position i (this element is not equal to element at position n-i), and add one element at position k (also not equal to element at position n-k), then we will have “no” answer.

  4. Randomize any element: this way is not sure that you will have an palindrome or not, but if having a sequence, you can run your code to check whether “yes” or “no”.

That is my opinion. Sorry for my bad english. :slight_smile:

1 Like

I was author of problem. You can find my generator for the problem here

3 Likes

@leduongtuananh

Thanks for sharing your opinion… :slight_smile:

Thank you @dpraveen:slight_smile: