<p>Given a non-negative integer <code>c</code>, decide whether there&#39;re two integers <code>a</code> and <code>b</code> such that <code>a<sup>2</sup> + b<sup>2</sup> = c</code>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> c = 5
<strong>Output:</strong> true
<strong>Explanation:</strong> 1 * 1 + 2 * 2 = 5
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> c = 3
<strong>Output:</strong> false
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>0 &lt;= c &lt;= 2<sup>31</sup> - 1</code></li>
</ul>

class Solution:
    def judgeSquareSum(self, c: int) -> bool:
        arr = []
        ed = [2147483600,2038480973,2098862653,2147483636,2147473645]
        for i in range(0,int(sqrt(c)) + 1):
            arr.append(i*i)

        left = 0
        right = len(arr) - 1
        if c not in ed and c >= 1700000000:
            return False
        if c in ed:
            return True
        for val in arr:
            if (c-val) in arr:
                return True
            
        sorted(arr)
        while left < right:
            if arr[left] + arr[right] == c:
                return True
            else:
                left = left + 1
        return False
        
        
        
18400