<commit_before>package com.sid.leetcode;

/**
 * 9. Palindrome Number.
 *
 * <blockquote>
 * Determine whether an integer is a palindrome. Do this without extra space.
 * </blockquote>
 *
 * @author Sid.Chen
 * @version 1.0, 2016-07-26
 *
 */
public class A0009_PalindromeNumber {

	public boolean isPalindrome(int x) {
		if (x < 0) return false;
		if (x < 10) return true;

		int multiple = 1;
		while (x / multiple >= 10) {
			multiple *= 10;
		}

		while(multiple > 1) {
			if (x / multiple != x % 10) return false;
			x %= multiple;
			x /= 10;
			multiple /= 100;
		}
		return true;
	}

}<commit_msg>Add solution to #9 Palindrome Number<commit_after>package com.sid.leetcode;

/**
 * 9. Palindrome Number.
 *
 * <blockquote>
 * Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.
 * Do this without extra space.
 * </blockquote>
 *
 * @author Sid.Chen
 * @version 1.1, 2019-06-30
 *
 */
public class A0009_PalindromeNumber {

	public boolean isPalindrome(final int x) {
		if (x < 0) return false;
		if (x < 10) return true;
        if (x % 10 == 0) return false;
		
		int reverse = 0, temp = x;
		while (temp > reverse) {
			reverse = reverse * 10 + temp % 10;
			temp /= 10;
		}
		return reverse == temp || reverse / 10 == temp;
	}

}
{'fraction_non_alphanumeric': 0.12873563218390804, 'fraction_numerical': 0.0475095785440613, 'mean_word_length': 2.785507246376812, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4667572', 'n_tokens_mistral': 546, 'n_tokens_neox': 452, 'n_words': 154}