Skip to content

Conversation

yeongleej
Copy link
Contributor

No description provided.

Comment on lines +8 to +17
while(i >= 0) {
System.out.println("i: "+i);
System.out.println("d: "+Arrays.toString(deliveries));
System.out.println("p: "+Arrays.toString(pickups));

// 배달과 수거 모두 끝난 집은 pass
if(deliveries[i] ==0 && pickups[i] ==0){
i--;
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

현재 위치를 다음 집으로 옮겨주고, 배달이나 수거를 못마친 집을 재방문하게 하는 부분이 어려웠는데,
저는 while 말구 for문을 썼어서 로직이 지저분 해 졌던거 같네요 ㅜㅜ (그래서 결국 해설을 봐버렸어요)

같은 위치를 다시 방문해야 할 때는 while다음 위치 이동을 위한 조건 로직 을 적절히 사용 해 봐야겠어요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

저도 처음에는 배달과 수거를 같이 생각했는데 문제 예시보니깐 따로 생각해야 하더라고요!! 문제를 더 잘 이해하는 것도 중요한 것 같습니다 !! ㅠㅜㅜ

Comment on lines +32 to +41
Copy link
Contributor

Choose a reason for hiding this comment

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

저도 매개변수 탐색을 생각하긴 했었는데 대단해여

Copy link
Contributor Author

@yeongleej yeongleej Oct 31, 2024

Choose a reason for hiding this comment

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

ㅎㅎㅎㅎ 결론은 N이 작아 그냥 풀면됐지만,,,, 이분탐색 연습한걸로,,,, ㅎㅎㅎㅎ

Copy link
Contributor

Choose a reason for hiding this comment

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

저는 투포인터하면 한줄배열을 떠올리게되는데, 각 반별로 포인터를 둬서 값을 비교해나가는 방법 멋있네요!👍

@jewan100 jewan100 merged commit de8b312 into GreatAlgorithm-Study:main Nov 2, 2024
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