It’s quite frustrating when our code shows wrong answer on verdict where it seems to us completely correct and then we make some test cases but still the story remains same,
now in a order to tackle this situation you have to make a program which generates test cases
here is the link to a youtube vedio which explains this technique
https://www.youtube.com/watch?v=-AcDqd_iT3k&list=PLMCXHnjXnTnsWU7jYp9XCKPW8ayl6D8fb&index=4&t=0s
vedio explain test cases generation in java but the technique can be applied to any language like i applied it in python
i made two functions where the 1st function contains the optimised code and 2nd is the bruteforce and then the code generate some random integers and they are passed to both of the functions and if the output differs then we stop and print the test case where the output is different
i applied this technique to “guddu and his mother” problem from august challenge where i was getting wrong answer and after checking it on randomly generated test cases i was able to get the test case where my optimised program was failing
here is the image which shows my implementation, just in sake of showing important part i have hidden the code of both of the function they are just returning the values after executing the test case
if you find something missing or if you know any other better technique than please let me know your suggestions are welcome ![]()

). And as you said, run it like 







