회문
-
leetcode easy - Palindrome Number개발 나누고 더하기/코딩 테스트 2023. 7. 30. 15:26
문제 Given an integer x, return true if x is a palindrome, and false otherwise. Integer x가 주어졌을 때 이게 회문인지 검사하는 코드를 만들어야 한다. 121은 거꾸로해도 121이라 true, -121은 거꾸로하면 121- 이라 false, 10은 거꾸로하면 01이라 false가 된다. palindrome은 회문이라는 뜻이며, 어떤 단어나 구를 거꾸로해도 원본과 같은 경우를 일컫는다. 예를 들면 우영우, 기러기, 토마토, 스위스, 인도인, 별똥별과 같은 단어가 있다. 예전에 모기업에 지원할때 코딩테스트 문제로도 나왔어서 쉬운 문제임에도 불구하고 리뷰해보았다. 제약 사항 -2의31승 -1