Skip to content

Conversation

@Mordiumaco
Copy link
Collaborator

간단하지만..
우선 자바스크립트랑 자바로 풀어봤습니다.
파이썬은 아직 반복 숙달이 필요할꺼 같습니다.
파이썬 lambda가 익숙치 않네요.

Copy link
Collaborator

@whdgns5059 whdgns5059 left a comment

Choose a reason for hiding this comment

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

다양한 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단계 이상의 로직과 내부 반복문이 존재하는 걸 알 수 있습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

자리 수의 합을 구하기 위해 문자열로 바꾸고 그걸 List로 변형한뒤 stream api 를 이용하여 다시 숫자로 바꾸는 행위는 너무 비싼 비용을 지불하는 것 같습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

숫자를 문자열로 변형한뒤 배열로 바꾸고 다시 recduce를 이용해 합을 구하는건 너무 비싼 비용을 지불 하는것 같습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants