My code is running and giving the right output but still only some test cases are being passed, please check what is wrong with my code :/

this is the ide link

@aryapandey194_31bab11b21ee53fb you are doing 2 mistakes

  1. overflow you are taking n as int so n*n will overflow
  2. if n < 3 then print -1
    Coding Blocks IDE
    this is the changed code
    if issue still exists feel free to ask and if clear please mark it as resolved and rate my experience
1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like

could you please explain what it means by overflow?

@aryapandey194_31bab11b21ee53fb overflow means when the product of those 2 numbers exceds the limit of integer then it causes a issue

1 Like