9. Judgment of Palindrome Number

[copy title]:

Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.

Example 1:

Input: 121
Output: true

Example 2:

Input: -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.

Example 3:

Input: 10
Output: false
Explanation: Reads 01 from right to left. Therefore it is not a palindrome.

 [brute force solution]:

Time analysis:

Space Analysis:

 [Optimized]:

Time analysis:

Space Analysis:

[Wonderful output conditions]:

[Wonderful corner case]:

[Thinking question]:

[One sentence idea]:

[Input amount]: Empty: Normal situation: Extra large: Extra small: Special situations handled in the program: Abnormal situations (Illegal and unreasonable input):

[Paint]:

[One brush]:

[Second brush]:

[Three brushes]:

[Four brushes]:

[Five brushes]:

  [Results of five-minute naked eye debug]:

[Summarize]:

[Complexity]: Time complexity: O( ) Space complexity: O( )

[English data structures or algorithms, why not use other data structures or algorithms]:

[Key templating code]:

[Other solutions]:

[Follow Up]:

[The topics given by LC change and change]:

 [Code style]:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325080285&siteId=291194637