Skip to content

Conversation

@haemin4738
Copy link
Collaborator

@haemin4738 haemin4738 commented Jul 1, 2025

📌 문제 링크

✨ 풀이 요약

  • OR 연산으로 겹치는 벽 확인
  • 2진수 변환 후 길이 맞춤
  • 0 -> ' ', 1 -> '#"으로 시각화

[이해민] 꽉 자바 첫 주 프로그래머스 17681번
@haemin4738 haemin4738 closed this Jul 1, 2025
@haemin4738 haemin4738 reopened this Jul 1, 2025
Copy link
Member

@Yoepee Yoepee left a comment

Choose a reason for hiding this comment

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

IMHO
toBinaryString이랑 replace를 사용하면 좀 더 편하게 만들 수 있을 것 같습니다.

@haemin4738 haemin4738 changed the title Create PG_17681.java [PG_17681] 비밀지도 풀이 Jul 1, 2025

// 이진수는 뒤에서부터 채워야 하므로, 배열의 끝에서부터 채움
for (int i = 0; i < length; i++) {
answer[length - i - 1] = value % 2; // 2로 나눈 나머지를 저장 (0 또는 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

저라면 귀찮아서 toBinaryString 써서 풀었을 것 같은데.. 대단하십니다 .. 직접 구현하는 방법 알고 갑니다!

@Yoepee Yoepee merged commit 7797b43 into main Jul 1, 2025
1 check passed
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.

4 participants