Skip to content

[정기적 문제 풀이 추가 PR] 2022.04.12 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 13, 2022

Conversation

prove-ability
Copy link
Contributor

@prove-ability prove-ability commented Apr 12, 2022

Update 19문제

  • 하샤드-수.js
  • 2016년.js
  • 가운데-글자-가져오기.js
  • 모의고사.js
  • 문자열-다루기-기본.js
  • 문자열을-정수로-바꾸기.js
  • 자릿수-더하기.js
  • 자연수-뒤집어-배열로-만들기.js
  • 제일-작은-수-제거하기.js
  • 직사각형-별찍기.js
  • 짝수와-홀수.js
  • 체육복.js
  • 콜라츠-추측.js
  • 평균-구하기.js
  • 폰켓몬.js
  • 핸드폰-번호-가리기.js
  • k번째수.js
  • x만큼-간격이-있는-n개의-숫자.js
  • 행렬의-곱셈.js

Copy link
Owner

@codeisneverodd codeisneverodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주석을 정말 꼼꼼히 달아주셔서 재미있게 읽었습니다! 제가 한 코멘트는 반영하실 필요는 없고 참고만 해주시면 감사하겠습니다!! 고생하셨습니다 👍

// a 이전 모든 달의 일 수를 더한다
for(let i = 0, len = a - 1; i < len; i++) {
totalDays += daysOfMonth[i];
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

60-64 라인을 const totalDays = daysOfMonth.slice(0, a-1).reduce((acc, curr) => acc + curr, 4)
와 같이 명령형이 아닌 선언형으로 해보시는 것도 좋을 것이라 생각합니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다음에 참고해서 멋진 코드 짜보겠습니다 :D

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아닙니다 제 코드는 엉망인걸요 ㅠㅠ 이미 멋진 코드를 짜고 계십니다 👍

if(s.length === 4 || s.length === 6) {
for(let i = 0, len = s.length; i < len; i++) {
// 숫자로만 구성돼있는지 확인
if(!Number.isInteger(parseInt(s[i], 10))) return false;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

29번 조건분이 isNaN 함수로 대체 될 수 있을 것으로 생각됩니다!
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/isNaN

@prove-ability prove-ability merged commit ae66091 into codeisneverodd:main Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants