Skip to content

[Helena] Week 14 solutions #215

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

Merged
merged 2 commits into from
Aug 5, 2024
Merged

[Helena] Week 14 solutions #215

merged 2 commits into from
Aug 5, 2024

Conversation

yolophg
Copy link
Contributor

@yolophg yolophg commented Aug 3, 2024

  • Spiral Matrix
  • Set Matrix Zeroes
  • Sum of Two Integers

@yolophg yolophg marked this pull request as ready for review August 3, 2024 20:41
// add the first element of each remaining row to the result in reverse order
for (let i = matrix.length - 1; i >= 0; i--) {
if (matrix[i].length > 0) {
result.push(matrix[i].shift());
Copy link
Member

@DaleSeo DaleSeo Aug 3, 2024

Choose a reason for hiding this comment

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

shift() 함수의 시간 복잡도를 O(n)으로 알고 있어요. 맨 앞에 있는 값을 제거한 후에 기존에 배열에 있던 모든 요소를 한 자리씩 왼쪽으로 이동시켜야 하기 때문이죠. 시간 복잡도 분석에 대한 재고가 필요할 것 같습니다.

Copy link
Contributor

@bky373 bky373 left a comment

Choose a reason for hiding this comment

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

그동안 고생 많으셨습니다!!

@yolophg yolophg merged commit 21c536e into DaleStudy:main Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants