I am not able to find out the trend in the pattern like how the pattern varies from line to line, please help .
MANMOHAN LOVES PATTERNS - I problem
You can follow the basic approach tht when n is a prime no, output will be equal to all 1’s whereas when n is not a prime no, output will be such that your first and last columns will have values as 1, and all other elements as 0.
I have implemented the approach but still it is showing wrong answer for two test cases.
Thanks Yukti i got the logic and cleared my silly mistakes.