-
Notifications
You must be signed in to change notification settings - Fork 0
[LeetCode] 9. Palindrome Number #51
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
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
return true; | ||
}; |
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.
'Explanation: ' 부분은 구현 안하셨나요??
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.
저도 처음 이 문제 받았을 때는 구현을 했었는데요~!
리트코드에서 그냥 넣어주는 거였더라고요🤣
} | ||
|
||
return true; | ||
}; |
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.
바뀐 구현 방법이 코드가 간결하고 더 쉽게 구현이 되는것 같습니다.
10ms 라도 빨라진게 많이 바뀐것일 겁니다.
👍 👍
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.
제 PR 글 내용도 읽어보시는군여😏
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.
당근 다봐야죠 ㅎㅎㅎㅎ
구현 방법 1
4-1. 조건식으로 current가 0보다 클때까지 돌립니다.
4-2. current를 -1 합니다.
4-3. current 인덱스에 맞는 배열 요소를 result에 저장합니다.
아이디어
구현 방법 2
2-1. 맨 앞 인덱스와 맨 뒤에서 i를 뺀만큼의 인덱스를 확인하고 같지 않을 때
return false
를 반환합니다.아이디어