• Guide to incomplete palindrome / String [using C + +]


    Let’s look at the title: leetcode-9Palindrome, that is to say, forward reading and reverse reading are the same. For example, 12321 is a palindrome number and daaad is a palindrome string.If a string type is given, we can use [0] and. Size () – 1 to traverse the strings on both sides at the same […]

  • C / C + + Programming Notes: palindrome examples


          Palindrome number is the same number in reverse (read from the left and read from the right are the same number). For example: 121345431314894 these are palindromic numbers. Palindrome number algorithm Get numbers from user input Save the number in a temporary variable Reverse number Compare temporary numbers with inverted numbers If […]

  • Long palindromic substring


    Title: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: “babad” Output: “bab” Note: “aba” is also a valid answer. Example 2: Input: “cbbd” Output: “bb” Title Translation: Very classic topic, for the longest palindrome string How to solve […]

  • Leetcode 680. Verify palindrome string II | Python


    680. Verify palindrome string II Title Source: https://leetcode-cn.com/problems/valid-palindrome-ii subject Given a non empty string s, at most one character is deleted. Determine whether it can be a palindrome string. Example 1: Input: “ABA” Output: true Example 2: Input: “ABCA” Output: true Explanation: you can delete the C character. be careful: The string contains only lowercase […]

  • Python brush topic: Longest palindrome substring (string)


    Title Description Given a string containing only lowercase letters, find the length of its longest palindrome substring. Palindrome string refers to the character string with left and right symmetry. Thinking of solving problems When the string is not empty, the palindrome substring is at least one character, that is, the initial length is 1. When […]

  • The journey of leetcode


    subject Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1:Input: 121Output: true Example 2:Input: -121Output: falseExplanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. Example 3:Input: 10Output: falseExplanation: Reads 01 from right to left. […]

  • The beauty of discovery algorithm: collision pointer of two pointers


    What is a collision pointer? First knowledge Algorithm diagram Collision process diagram Array and collision pointer in JavaScript How to define collision pointer in JS? Implementation of a simplest collision pointer Leetcode collision pointer solution problem 7. Integer inversion (easy) 9. Palindrome number (easy) 27. Remove element (easy) 125. Verify palindrome string (easy) 167. II […]

  • Leetcode 9. Palindrome number in Python


    Title Requirements: Idea 1 (converting STR to list) First judge whether the number is less than 0, and return false if it is less than 0 Judge whether the number is less than 10. If it is less than 10, return true, because the single digit is palindrome If the above two items do not […]

  • On palindrome number


    Title Description For a natural number n, if the number N1 obtained by inversing the digits of n is equal to N, then n is called palindrome number, such as 2332.If given an n (2 < = n < = 16) base number m (the length of M is less than 100 bits), if M […]

  • Brush leetcode series with 233 sauce


    PS: I give myself a nickname. You can call me 233 sauce Why brush leetcode To quote from the left ear mouse uncle mouse: ““ The questions on leetcode are used by some classic companies to interview candidates. Many people use these questions to apply for companies that like interview algorithms, such as Google, Microsoft, […]

  • Leetcode 125. Verify palindrome string | Python


    125. Verify palindrome string Title Source: leetcode https://leetcode-cn.com/problems/valid-palindrome subject Given a string, verify whether it is palindrome string, only consider alphabetic and numeric characters, can ignore the case of letters. Note: in this topic, we define an empty string as a valid palindrome string. Example 1: Input: “a man, a plan, a canal: Panda” Output: […]

  • [longest palindrome substring of leetcode Hot 100]


    The first question of new year’s brush is as follows: Give you a string s and find the longest palindrome substring in S.   Example 1: Enter: S = “bad”Output: “bab”Explanation: “ABA” is also the answer to the question.Example 2: Enter: S = “CBBD”Output: “BB”Example 3: Input: S = “a”Output: “a”Example 4: Enter: S = […]