#include
using namespace std;
int main() {
int n;
cin>>n;
int a=n+1;
int b=n+2;
int c=nn+aa;
int v=b*b;
if(n>=0) {
if(c==v) {
cout<<a<<" β<<b;
}
else{
cout<<β-1";
}}
else{
return 0;
}}
Pythagorean triplet problem(3 test cases failed)
Hello @Abhishek4799,
This logic is not optimal to approach this problem.
I would suggest you watch the video: Pythagorean Triplet Hint of your course.
They have explained a constant time approach for it.
Let me know if you donβt understand anything.
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.