Skip to content
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

[Chaerin dev] 2022.04.01(금) 풀이 9문제 추가 #18

Merged
merged 10 commits into from
Apr 1, 2022

Conversation

chaerin-dev
Copy link
Contributor

[풀이 추가]
핸드폰 번호 가리기
하샤드 수
평균 구하기
콜라츠 추측
짝수와 홀수
문자열을 정수로 바꾸기
서울에서 김서방 찾기
수박수박수박수박수박수
두 정수 사이의 합

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.

좋은 코드 잘 보았습니다! 주석도 꼼꼼히 달아주신 것이 많아서 참고하기 너무 좋았습니다. 감사합니다 😄

function solution(n) {
// "수박"을 n번 반복한 문자열의 0번 인덱스부터 n만큼 추출해서 반환
return "수박".repeat(n).substr(0, n);
Copy link
Owner

Choose a reason for hiding this comment

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

이렇게 하는게 더 보기 좋은 방법 같네요! 보고 배워갑니다 😄
다만 substr은 deprecated되어서 slice를 사용하시는 것도 좋아보입니다!
MDN substr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

앗 몰랐던 정보네요.. 감사합니다!!

@codeisneverodd codeisneverodd merged commit c16d8ab into codeisneverodd:main Apr 1, 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