Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Cygra committed Apr 28, 2021
1 parent db5cb06 commit 702be88
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 0633. 平方数之和.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 633. 平方数之和

给定一个非负整数 c ,你要判断是否存在两个整数 a 和 b,使得 a2 + b2 = c 。

---

```js
/**
* @param {number} c
* @return {boolean}
*/
var judgeSquareSum = function(c) {
for (var i = 0; i * i <= c; i ++) {
var b = Math.sqrt(c - i * i)
if (b === parseInt(b)) return true
}
return false
};

```

0 comments on commit 702be88

Please sign in to comment.