Skip to content

Conversation

@gretea5
Copy link
Member

@gretea5 gretea5 commented Nov 29, 2023

📖 풀이한 문제

💡 문제에서 사용된 알고리즘

  • 수학

📜 해결 방법

  1. 배열에 N + 1 길이만큼 선언하고 arr[i] = i 형식으로 초기화한다.
  2. (x, y) 쌍에서 arr[x]는 1을 더해주고, arr[y]는 1을 빼준다.
  3. 1~N 범위를 벗어나는지, 중복된 숫자가 있는지 검증하고, 만약에 조건에 부합한다면 -1을 출력한다.
  4. 카드 번호를 출력한다.

@gretea5 gretea5 requested a review from fkgnssla November 29, 2023 03:29
@gretea5 gretea5 self-assigned this Nov 29, 2023
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