a2 + b2 = c2 , 1 <= a, b, c <= n 를 만족하는 쌍을 찾아라
ex) n = 10, 답 : 4
(3,4,5), (4,3,5), (6,8,10), and (8,6,10).
const arr=[]
let count=0
for(let i=1;i<=n;i++){
arr.push(i*i)
}
for(let i=0;i<arr.length;i++){
for(let j=0;j<arr.length;j++){
if(arr.includes(arr[i]+arr[j])){
count ++
}
}
}
return count
const arr=[]
for(let i=1;i<=n;i++){
arr.push(i*i)
}
let count=0
for(let i=0;i<arr.length;i++){
for(let j=0;j<arr.length;j++){
if(arr.includes(arr[i]+arr[j])){
count ++
}
}
}
return count