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

resolve #134-common-child 문제풀이 및 문서추가 #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

heeveloper
Copy link
Collaborator

No description provided.

@heeveloper heeveloper requested a review from yeonjuan August 13, 2019 14:14

return acc;
}, []);
row.push(0);
Copy link
Owner

Choose a reason for hiding this comment

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

 let row = s1.reduce(acc => {
    acc.push(0);

     return acc;
  }, []);
  row.push(0);

이 코드의 의도가 뭔지 궁금합니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

s1 사이즈를 사용해 배열을 사전에 초기ㅗㅘ하려는거 입니다

Copy link
Owner

Choose a reason for hiding this comment

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

배열을 초기화 하는 코드는 Array.from, 과 Array.fill 을 사용하는 편이 좋을것 같습니다.

*/

const lca = (string1, string2) => {
const s1 = (string1.length <= string2.length) ? [...string1] : [...string2];
Copy link
Owner

Choose a reason for hiding this comment

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

string1 이 s1 이 될지, string2 가 s1 이될지 불분명해 보이는데. longer, shorter 와 같이 의미있는 이름을 쓰면 더 명확해질것 같습니다.

Copy link
Owner

@yeonjuan yeonjuan left a comment

Choose a reason for hiding this comment

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

.

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