Open
Conversation
whdgns5059
reviewed
Jul 7, 2020
Collaborator
whdgns5059
left a comment
There was a problem hiding this comment.
다양한 api가 사용되는 건 좋지만 요구사항에 비해 너무 큰 비용을 지불 하는건 아닌가 합니다.
실제로 내부 api가 어떻게 동작하는지 확인하기 위해 ECMA script 스펙문서를 를 확인해 봤습니다
split(https://www.ecma-international.org/ecma-262/5.1/#sec-15.5.4.14)
reduce(https://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.21)
적어도 10단계 이상의 로직과 내부 반복문이 존재하는 걸 알 수 있습니다.
week1/1. 하샤드 수/Solution.java
Outdated
Collaborator
There was a problem hiding this comment.
자리 수의 합을 구하기 위해 문자열로 바꾸고 그걸 List로 변형한뒤 stream api 를 이용하여 다시 숫자로 바꾸는 행위는 너무 비싼 비용을 지불하는 것 같습니다.
week1/1. 하샤드 수/solution.js
Outdated
Collaborator
There was a problem hiding this comment.
숫자를 문자열로 변형한뒤 배열로 바꾸고 다시 recduce를 이용해 합을 구하는건 너무 비싼 비용을 지불 하는것 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
간단하지만..
우선 자바스크립트랑 자바로 풀어봤습니다.
파이썬은 아직 반복 숙달이 필요할꺼 같습니다.
파이썬 lambda가 익숙치 않네요.