-
Notifications
You must be signed in to change notification settings - Fork 2
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
53-tgyuuAn #184
53-tgyuuAn #184
Conversation
for i in range(4): | ||
copy_arr = copy.deepcopy(arr) | ||
if i == 0: | ||
dfs(n + 1, left(copy_arr)) | ||
elif i == 1: | ||
dfs(n + 1, right(copy_arr)) | ||
elif i == 2: | ||
dfs(n + 1, up(copy_arr)) | ||
else: | ||
dfs(n + 1, down(copy_arr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
왼쪽으로 움직인 경우를 만든 후에
오른쪽으로 움직일 때는 왼쪽으로 움직인 게임판을 이어서 이용하는 것이 아니라
왼쪽으로 움직이기 전의 게임판을 오른쪽으로 움직여야 하기 때문에
깊은 복사를 통해서 하게 되었군요!!!
이팀은 문제 수준이 너무 높은데 내일부터 잘부탁드립니다!!!!!!🔥🔥🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문제 수준 높지 않습니다... 다 하면 풀리는 것들 ....!!!!!!!!!!!! 아자뵤!!!!!!!!!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 문제 쉽지 않네요 .. 😅
아침부터 문제 고민하다가 태규님 코드 + 레퍼런스 보고 겨우 이해했습니다 .. ㄷㄷ
최종 코드가 생각보다 단순하네요 쩝.. 다음에 문제 재도전해보겠습니다 🔥🔥🔥
deepcopy << 이거 처음 알았어요
python의 shallow copy 와 deep copy에 대해서 알아갑니다 !!
shallow copy는 참조값을 복사하므로 shallow copy된 데이터를 수정하면 원본이 바뀌고,
deep copy는 객체를 복사하므로 deep copy된 데이터를 수정하면 원본이 바뀌지 않는다!
덕분에 알아갑니닷 ~!!! (_ _) feat. @9kyo-hwang & @gjsk132
와우 이번에 deepcopy에 대해서 얻어가셨군요 아주 네이쑤~~~~~~~~~~~~~~~~~~~~~~ 👏🏻👏🏻👏🏻 |
🔗 문제 링크
2048 (Easy)
✔️ 소요된 시간
3시간
하.... 진짜 구현 짜중나네요...
✨ 수도 코드
구현 자체는 매우 간단합니다.
보드의 크기가 최대
20
이고 최대 5번으로 만들 수 있는 최대 수를 구하는 로직이기 때문에,최근에 홍주님이 열심히 공부하고 계시는 백트래킹 활용하면
으로 풀 수 있어요. 근데 이제 구현이 너무 귀찮은..
저도 한 2시간 잡고 있다가 화딱지나서 레퍼런스 보고 풀었습니다.
풀이는 진짜 간단한데... 건강에 해로운 문제에요...
📚 새롭게 알게된 내용