Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 435 Bytes

9.回文数.md

File metadata and controls

36 lines (28 loc) · 435 Bytes
title categories
回文数
leetcode
leetcode题解
package main

import "strconv"

/*
 * @lc app=leetcode.cn id=9 lang=golang
 *
 * [9] 回文数
 */

// @lc code=start
func isPalindrome(x int) bool {

	bigString := strconv.Itoa(x)
	for i := 0; i <= len(bigString)/2; i++ {
		if bigString[i] == bigString[len(bigString)-1-i] {
			continue
		} else {
			return false
		}

	}
	return true



// @lc code=end
}