반응형
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- javascript
- 폼
- HTML
- nextjs
- Challenge
- Collapse
- level1
- React
- Prettier
- 상호 평가
- next
- Weekly Challenge
- js
- form
- javscript
- component
- MaterialUI
- 리액트
- Weekly
- solution
- split
- From
- 알고리즘
- Javasript
- programmers
- redux-toolkit
- array
- 직업군 추천하기
- algorithm
- eslint
Archives
- Today
- Total
기록
[Level1] 정수 제곱근 판별 본문
문제
내 풀이
Math 내장함수를 활용하여 푼다.
const solution = (n) => Number.isInteger(Math.sqrt(n)) ? Math.pow(Math.sqrt(n) + 1, 2) : -1
출처: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Math
Math - JavaScript | MDN
Math는 수학적인 상수와 함수를 위한 속성과 메서드를 가진 내장 객체입니다.
developer.mozilla.org
반응형
'Algorithm > Programmers' 카테고리의 다른 글
[Level1] 자연수 뒤집어 배열로 만들기 (0) | 2021.07.14 |
---|---|
[Level1] 정수 내림차순으로 배치하기 (0) | 2021.07.14 |
[Level1] 제일 작은 수 제거하기 (0) | 2021.07.13 |
[Level1] 짝수와 홀수 (0) | 2021.07.13 |
[Level 1] 최대공약수와 최소공배수 (0) | 2021.07.12 |
Comments