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

1주차 PR #13

Merged
merged 4 commits into from
Dec 10, 2024
Merged

1주차 PR #13

merged 4 commits into from
Dec 10, 2024

Conversation

southppp22
Copy link
Collaborator

No description provided.

@southppp22 southppp22 self-assigned this Nov 29, 2024
@wwwr-kim0en
Copy link
Owner

wwwr-kim0en commented Nov 29, 2024

수정하신 부분 확인했습니다 !

제가 지금 PR을 올린 상태라 main 브랜치가 업데이트가 불가능해 코멘트로 남깁니다.
.github 디렉토리 > workflows 디렉토리 > set_reviewers.yml 을 다음과 같이 수정해주세요.

name: Auto Assign Reviewers

on:
  pull_request:
    types: [opened, ready_for_review]

permissions:
  pull-requests: write # PR 관련 권한 추가
  contents: read # 코드 내용 읽기 권한 추가

jobs:
  assign-reviewers:
    runs-on: ubuntu-latest
    steps:
      - name: Auto Assign Reviewers
        uses: actions/github-script@v6
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            const reviewers = [
              'wwwr-kim0en',
              'kwonjounghun',
              'nagyum',
              'onblana',
              'NonamedBread',
              'JiHoon-0330',
              'JANGSEYEONG'
            ];

            // PR 작성자 제외
            const prAuthor = context.payload.pull_request.user.login;
            const availableReviewers = reviewers.filter(reviewer => reviewer !== prAuthor);

            // 랜덤하게 3명 선택
            const shuffled = availableReviewers.sort(() => 0.5 - Math.random());
            const selectedReviewers = shuffled.slice(0, 3);

            // 리뷰어 설정
            await github.rest.pulls.requestReviewers({
              owner: context.repo.owner,
              repo: context.repo.repo,
              pull_number: context.payload.pull_request.number,
              reviewers: selectedReviewers
            });

Copy link
Owner

@wwwr-kim0en wwwr-kim0en left a comment

Choose a reason for hiding this comment

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

수도코드를 명시적으로 작성하셨네요! 저도 습관화를 위해 다음부터는 적어봐야겠습니다! 첫 주차 고생많으셨습니다!

Copy link
Owner

Choose a reason for hiding this comment

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

이 풀이도 확인하시면 좋을 것 같습니다~!

function findLongestSubstring(str) {
  let start = 0;
  let result = 0;
  const charMap = new Map();

  for (let end = 0; end < str.length; end++) {
    const char = str[end];
    
    // 이미 문자가 존재하고, 해당 문자의 인덱스가 현재 시작 지점보다 크거나 같다면
    if (charMap.has(char) && charMap.get(char) >= start) {
      // 시작 지점을 중복 문자의 다음 인덱스로 이동
      start = charMap.get(char) + 1;
    }
    
    // 현재 문자의 인덱스 업데이트
    charMap.set(char, end);
    
    // 현재 윈도우 크기와 최대 결과 비교
    result = Math.max(result, end - start + 1);
  }

  return result;
}

@wwwr-kim0en wwwr-kim0en merged commit 00e20d1 into wwwr-kim0en:main Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants