Given an integer n, return true if it is a power of three. Otherwise, return false.
An integer n is a power of three, if there exists an integer x such that n == 3x.
-231 <= n <= 231 - 1
Java 언어를 사용하여 개발하다 보면
“숫자 / 영어 소문자 / 영어 대문자” 를 찾아내는 상황을 자주 접한다.
그런 상황에 유용하게 쓸 수 있는 다양한 코드들을 정리해 보았다.
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
Note: For the purpose of this problem, we define empty string as valid palindrome.
Given a singly linked list, determine if it is a palindrome.
Could you do it in O(n) time and O(1) space?
Input: 1->2->2->1
Output: true
아시는 분이 작성하신 배우고 시도하는 과정에서 필요한 것들 글을 읽었는데
글이 너무 따듯하고 요즈음 심신이 지친 나에게 괜찮다고 위로를 해주는 듯한 느낌을 받았다.
너무나 마음에 들고 나중에 또 보고 싶은 글이라 작성자분에게 허락을 구하고 글을 퍼왔다.
참고로 원글의 테마와 구성을 하고 올 순 없어서 가능하다면 꼭 원글을 보도록 하자 !
Reverse bits of a given 32 bits unsigned integer.
Input: n = 00000010100101000001111010011100
Output: 964176192 (00111001011110000010100101000000)
Explanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 00111001011110000010100101000000.