New update is available. Click here to update.

Posted: 15 Oct, 2020

Difficulty: Moderate

```
1. The integers x,y and z might not be distinct , but they should be present at different locations in the array i.e if a[i] = x, a[j] = y and a[k] = z, then i,j and k should be pairwise distinct.
2. The integers a,b and c can be present in any order in the given array.
```

```
The first line contains a single integer t - the number of test cases. Each test case consists of 2 lines as follows:
The first line of each test case will contain the integer n, denoting the total number of elements in the array.
The second line of each test case will contain n space-separated integers a1,a2,....,an , where ai is the ith element of the array..
```

```
For each test case, print “yes”, if the array contains a pythagorean triplet,”no” otherwise.
```

```
You do not need to print anything, it has already been taken care of. Just implement the given function.
```

```
1 <= T <= 10
3 <= N <= 10^3
1 <= a[i] <= 10^4
Time Limit: 1sec
```

SIMILAR PROBLEMS

Merge Two Sorted Arrays Without Extra Space

Posted: 19 Nov, 2022

Difficulty: Moderate

Ninja And The Strictly Increasing Array

Posted: 27 Nov, 2022

Difficulty: Moderate

Maximum GCD

Posted: 8 Dec, 2022

Difficulty: Hard

Negative To The End

Posted: 16 Dec, 2022

Difficulty: Easy

Sort 0s, 1s, 2s

Posted: 24 Dec, 2022

Difficulty: Easy

Categories:

Popular Courses: