
[프로그래머스] Lv 1 하샤드 수
주석문을 보면 알겠지만 이번엔 일부로 코드가 깔끔한 코드를 먼저 올려봤다. 만약 저 코드를 저렇게 요약하지 않고 내 방식대로 썼다면 아래와 같다. 위 사진을 보면 맨처음에 올렸던 코드가 정말 간결하다는걸 알 수 있다. 내가 봐도 보기가 편하고 깔끔하다. 제일 위 사진과 같은 코딩을 하자.
주석문을 보면 알겠지만 이번엔 일부로 코드가 깔끔한 코드를 먼저 올려봤다. 만약 저 코드를 저렇게 요약하지 않고 내 방식대로 썼다면 아래와 같다. 위 사진을 보면 맨처음에 올렸던 코드가 정말 간결하다는걸 알 수 있다. 내가 봐도 보기가 편하고 깔끔하다. 제일 위 사진과 같은 코딩을 하자.
근데 이러한 코딩법 자체가 또 코딩테스트를 통과하기 위한 코딩으로 어떻게 보면 다른 생각없이 가장 효율적으로 해결하는 방법일 듯 하다.
이 문제는 sqrt 함수를 알고 있었다면 아주 쉽게 풀 수 있는 문제였다. 함수의 활용은 코드를 굉장히 간결하게 해주기 때문에 될 수 있으면 찾을 수 있다면 무조껀 함수를 활용하자
자세한 설명 클릭 GitHub - leemeo3/algorithm: This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.c This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.com/BaekjoonHub/BaekjoonHub). - GitHub - leemeo3/algorithm: This is a auto push repository for Bae... github.com
자세한 정보 클릭 GitHub - leemeo3/algorithm: This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.c This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.com/BaekjoonHub/BaekjoonHub). - GitHub - leemeo3/algorithm: This is a auto push repository for Bae... github.com answer[cnt++] = Integer.parseInt(String.valueOf..
자세한 정보 클릭 GitHub - leemeo3/algorithm: This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.c This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.com/BaekjoonHub/BaekjoonHub). - GitHub - leemeo3/algorithm: This is a auto push repository for Bae... github.com charAt 자료형을 쓰면은 문자가 아스키코드로 변환되기때문에 String.value..
자세한 정보 클릭 GitHub - leemeo3/algorithm: This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.c This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.com/BaekjoonHub/BaekjoonHub). - GitHub - leemeo3/algorithm: This is a auto push repository for Bae... github.com 문자열을 char 자료형으로 변환해 배열로 만들면 아스키코드로 변환되기 때문에 그 값..
자세한 정보 클릭 GitHub - leemeo3/algorithm: This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.c This is a auto push repository for Baekjoon Online Judge created with [BaekjoonHub](https://github.com/BaekjoonHub/BaekjoonHub). - GitHub - leemeo3/algorithm: This is a auto push repository for Bae... github.com 이 문제 자체는 어떻게 보면 어려울수도 있으나 창의력을 발휘하면 굉장히 쉽게 해결 할..