08. Pythagorean Triplet
✅ GFG solution to the Pythagorean Triplet problem: determine whether three numbers in an array satisfy a² + b² = c² using hashing and mathematical observation. 🚀
🧩 Problem Description
📘 Examples
Example 1
Input: arr[] = [3, 2, 4, 6, 5]
Output: true
Explanation: a=3, b=4, and c=5 forms a Pythagorean triplet.Example 2
Input: arr[] = [3, 8, 5]
Output: false
Explanation: No such triplet possible.Example 3
Input: arr[] = [1, 1, 1]
Output: false
Explanation: 1² + 1² = 2 ≠ 1², so no valid triplet exists.🔒 Constraints
✅ My Approach
Hash Set of Squares
📝 Time and Auxiliary Space Complexity
🧑💻 Code (C++)
🧑💻 Code (Java)
🐍 Code (Python)
🧠 Contribution and Support
📍Visitor Count
Last updated